J
JB
Hi Folks,
How can I loop through the number of bookmarks in a document assigning the
name to a VAR and output it to a file? It's mainly the parsing of the
bookmark name from the bookmark property I need as I can do teh rest from
there.
I can loop through the file holding the names of the bookmark and add them
to a doc but I can't seem to retrieve them!
Cheers
J
p.s. here's what I tried
If ActiveDocument.Bookmarks.Count > 1 Then
BKMCount = ActiveDocument.Bookmarks.Count
ReDim aMarks(BKMCount)
i = 0
For i = 0 To BKMCount Step 1
aMarks = ActiveDocument.Bookmarks.Item(i)
Next i
filename = "C:\test2.txt"
filenumber = FreeFile
Open filename For Input As #filenumber
On Err GoTo Closefile
Do While Not (EOF(filenumber))
Input #filenumber, aMarks(i)
i = i + 1
Loop
Closefile:
Close #filenumber
How can I loop through the number of bookmarks in a document assigning the
name to a VAR and output it to a file? It's mainly the parsing of the
bookmark name from the bookmark property I need as I can do teh rest from
there.
I can loop through the file holding the names of the bookmark and add them
to a doc but I can't seem to retrieve them!
Cheers
J
p.s. here's what I tried
If ActiveDocument.Bookmarks.Count > 1 Then
BKMCount = ActiveDocument.Bookmarks.Count
ReDim aMarks(BKMCount)
i = 0
For i = 0 To BKMCount Step 1
aMarks = ActiveDocument.Bookmarks.Item(i)
Next i
filename = "C:\test2.txt"
filenumber = FreeFile
Open filename For Input As #filenumber
On Err GoTo Closefile
Do While Not (EOF(filenumber))
Input #filenumber, aMarks(i)
i = i + 1
Loop
Closefile:
Close #filenumber