WordBasic.WW2_EditFind instruction doesn't work in Word 2007

G

Gert

We have recently migrated to Word 2007. Some of the Makro's/programming in
the word-documents do no longer work. I'm new to programming in Word 2007, so
any help would be welcome. As far as I understand, the code generates a
pop-up form and after selection moves the cursor to the selected text in the
Word-document.

- Code -
Public Sub MAIN()

ReDim Item__$(82)
Item__$(0) = "1.1.1. Pannen"
Item__$(1) = "1.1.2. Leien"
Item__$(2) = "1.1.3. Metaal"
Item__$(3) = "1.1.4. Organische materialen"
Item__$(4) = "1.1.5. Bitumineuze"
Item__$(5) = "1.1.6. Andere"
Item__$(6) = "1.2.1. Nokken"
Item__$(7) = "1.2.2. Hoekkeperafwerking"
Item__$(8) = "1.2.3. Kilkeperafwerking"
Item__$(9) = "1.2.4. Topgevelbeëindiging"
Item__$(10) = "1.2.5. Zalingen"
Item__$(11) = "1.2.6. Opgaand muurwerk"
Item__$(12) = "1.2.7. Andere"
Item__$(13) = "2.1. Dakkapellen"
Item__$(14) = "2.2. Lichtkoepels / Lantaarns / Dakruiters"
Item__$(15) = "2.3. Dakramen en -luiken"
Item__$(16) = "2.4. Schoorstenen (bovendaks)"
Item__$(17) = "2.5. Topbekroningen"
Item__$(18) = "2.6. Ladder- en klimhaken"
Item__$(19) = "2.7. Verluchtingen"
Item__$(20) = "2.8. Andere"
Item__$(21) = "3.1. Kappen met houten hoofdstructuur"
Item__$(22) = "3.2. Kappen met metalen hoofdstructuur"
Item__$(23) = "3.3. Kappen met betonnen hoofdstructuur"
Item__$(24) = "4.1. Goten"
Item__$(25) = "4.2. Afvoer"
Item__$(26) = "4.3. Riolering"
Item__$(27) = "5.1. Opgaand baksteen-metselwerk + voegwerken"
Item__$(28) = "5.2. Natuursteen + voegwerken"
Item__$(29) = "5.3. Beton en aanverwante"
Item__$(30) = "5.4. Houten opgaand werk"
Item__$(31) = "5.5. Metalen opgaand werk"
Item__$(32) = "5.6. Afwerklagen opgaand muurwerk"
Item__$(33) = "5.7. Ankers, roosters en aanverwante"
Item__$(34) = "5.8. Muurbekroningen"
Item__$(35) = "5.9. Buitentrappen"
Item__$(36) = "5.10. Buitenschrijnwerk"
Item__$(37) = "5.11. Beglazing"
Item__$(38) = "5.12. Erkers en balkons"
Item__$(39) = "5.13. Galmborden"
Item__$(40) = "5.14. Andere"
Item__$(41) = "6.1.1. Binnenwanden en opgaande structuren"
Item__$(42) = "6.1.2. Vloeren en zolderingen"
Item__$(43) = "6.1.3. Gewelven"
Item__$(44) = "6.1.4. Kelders"
Item__$(45) = "6.1.5. Funderingen"
Item__$(46) = "6.2.1. Vaste wandafwerking"
Item__$(47) = "6.2.2. Vaste plafondafwerking"
Item__$(48) = "6.2.3. Vaste vloerafwerking"
Item__$(49) = "6.3. Binnenschrijnwerk"
Item__$(50) = "6.4. Binnentrappen / Loopbruggen"
Item__$(51) = "6.5. Andere"
Item__$(52) = "7.1. Vast kerkelijk meubilair"
Item__$(53) = "7.2. Vast burgerlijk meubilair"
Item__$(54) = "7.3. Los kerkelijk meubilair"
Item__$(55) = "7.4. Los burgerlijk meubilair"
Item__$(56) = "7.5. Andere voorwerpen"
Item__$(57) = "8.1. Bliksemafleiding"
Item__$(58) = "8.2. Klokkenstoelen / Torenuurwerken"
Item__$(59) = "8.3. Kruiwerk / sluiswerk bij molens"
Item__$(60) = "8.4.1. Aandrijving"
Item__$(61) = "8.4.2. Vangmechanisme"
Item__$(62) = "8.4.3. Overbrenging"
Item__$(63) = "8.4.4. Bewerkingsmechanismen"
Item__$(64) = "8.4.5. Andere installaties"
Item__$(65) = "8.4.6. Andere aandrijving"
Item__$(66) = "8.5. Andere"
Item__$(67) = "9.1. Relatieve vochtigheid en temperatuur"
Item__$(68) = "9.2. Licht"
Item__$(69) = "9.3. Andere"
Item__$(70) = "10.1. Brand"
Item__$(71) = "10.2. Diefstal en vandalisme"
Item__$(72) = "10.3. Bewaring"
Item__$(73) = "10.4. Reiniging"
Item__$(74) = "10.5. Andere"
Item__$(75) = "11.1. Toegankelijkheid / Bereikbaarheid"
Item__$(76) = "11.2. Vuilnis / Afval"
Item__$(77) = "11.3. Dieren"
Item__$(78) = "11.4. Andere"
Item__$(79) = "12.1. Bestrating / Terrein"
Item__$(80) = "12.2. Afsluiting"
Item__$(81) = "12.3. Bomen / Begroeiing"
Item__$(82) = "12.4. Andere"


WordBasic.BeginDialog 576, 498, "KIES ITEM"
WordBasic.OKButton 19, 470, 160, 21
WordBasic.CancelButton 401, 471, 160, 21
WordBasic.ListBox 18, 10, 545, 454, Item__$(), "Item"
WordBasic.EndDialog
On Error GoTo foutafhandeling
Dim KiesItem As Object: Set KiesItem = WordBasic.CurValues.UserDialog
WordBasic.Dialog.UserDialog KiesItem
WordBasic.WW7_EditGoTo Destination:="h0"
WordBasic.EditFindFont Points:="", Underline:=0, Color:=-1,
StrikeThrough:=-1, Superscript:=-1, Subscript:=-1, Hidden:=-1, SmallCaps:=-1,
AllCaps:=-1, Spacing:="", Position:="", Kerning:=-1, KerningMin:="",
Tab:="0", Font:="(Standaardtekst)", Bold:=-1, Italic:=-1
WordBasic.WW2_EditFind Find:=Item__$(KiesItem.Item), Direction:=2
If WordBasic.EditFindFound() Then
WordBasic.NextCell
WordBasic.NextCell
WordBasic.NextCell
WordBasic.NextCell
WordBasic.NextCell
WordBasic.NextCell
WordBasic.NextCell
Else
WordBasic.MsgBox "niet gevonden!", Item__$(KiesItem.Item), 64
End If
Exit Sub
foutafhandeling:
Exit Sub
End Sub

- End Code -

Can you recommend a good-website/book that can teach me the art of
programming in Word.?
 
D

Doug Robbins - Word MVP

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top