L
larryfergy
I have a document directory that consists of word documents and a table of
contents that relate to those documents. So I thought I would create
bookmarks as they relate in the table of contents. Then create adobe acrobat
pdf from that.
Well I had to modify the bookmarks with _ and some search fields. So I
massage them with c language. The following code works with the files I
created with C language.
The problem is that I can only create 9 bookmarks and the program finishes
prematurely without giving me a message why.
When I check out in word 2000 with inserting bookmarks I find the 9
bookmarks there but the dropdown box v isn't available. It can't add more
bookmarks .I also tried this code also :
"ActiveDocument.Bookmarks.ShowHidden = True
For Each aBookmark In ActiveDocument.Bookmarks
If Left(aBookmark.Name, 1) = "_" Then MsgBox aBookmark.Name
Next aBookmark
It ends up with the same unfilled record count. I know that there is at
least 12 more _ items to add with the above code by dies with just 9 records.
There is nothing wrong with files I've create
Heres my code below
Do While Not EOF(1)
Line Input #1, searchstring
Line Input #2, bookmarkfield
Set MyRange = ActiveDocument.Content
MyRange.Find.Execute findText:=searchstring, Forward:=True
If MyRange.Find.Found = False Then Exit Do
ActiveDocument.Bookmarks.ShowHidden = True
ActiveDocument.Bookmarks.Add Name:=bookmarkfield, Range:=MyRange
ActiveDocument.Bookmarks.ShowHidden = True
Rem MyRange.Bookmarks(counter).Add Name:=bookmarkfield
ActiveWindow.View.ShowBookmarks = True
primenumber = 0
counter = counter + 1
Loop
offset = offset + 1
Close #1
Close #2
contents that relate to those documents. So I thought I would create
bookmarks as they relate in the table of contents. Then create adobe acrobat
pdf from that.
Well I had to modify the bookmarks with _ and some search fields. So I
massage them with c language. The following code works with the files I
created with C language.
The problem is that I can only create 9 bookmarks and the program finishes
prematurely without giving me a message why.
When I check out in word 2000 with inserting bookmarks I find the 9
bookmarks there but the dropdown box v isn't available. It can't add more
bookmarks .I also tried this code also :
"ActiveDocument.Bookmarks.ShowHidden = True
For Each aBookmark In ActiveDocument.Bookmarks
If Left(aBookmark.Name, 1) = "_" Then MsgBox aBookmark.Name
Next aBookmark
It ends up with the same unfilled record count. I know that there is at
least 12 more _ items to add with the above code by dies with just 9 records.
There is nothing wrong with files I've create
Heres my code below
Do While Not EOF(1)
Line Input #1, searchstring
Line Input #2, bookmarkfield
Set MyRange = ActiveDocument.Content
MyRange.Find.Execute findText:=searchstring, Forward:=True
If MyRange.Find.Found = False Then Exit Do
ActiveDocument.Bookmarks.ShowHidden = True
ActiveDocument.Bookmarks.Add Name:=bookmarkfield, Range:=MyRange
ActiveDocument.Bookmarks.ShowHidden = True
Rem MyRange.Bookmarks(counter).Add Name:=bookmarkfield
ActiveWindow.View.ShowBookmarks = True
primenumber = 0
counter = counter + 1
Loop
offset = offset + 1
Close #1
Close #2