Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word Question
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Miscellaneous
Thread ID:
00460585
Message ID:
00460596
Views:
8
>I have the following VFP code that goes to a bookmark:
>with This.oWord
>   .Selection.GoTo(wdGoToBookmark, "Section_I_Table")
>Is there a test I can do to see if the bookmark was found? If the bookmark is not found, I obviously do not want to execute additional code. TIA!

Does this help?

FROM WORD VBA HELP
BookmarkID Property Example

This example displays the number of the bookmark that encloses the beginning of the selection.

MsgBox "Bookmark " & Selection.BookmarkID
This example adds a bookmark named "temp" at the beginning of the document if there's not already a bookmark set for that location.


Set myRange = ActiveDocument.Content
myRange.Collapse Direction:=wdCollapseStart
If myRange.BookmarkID = 0 Then
ActiveDocument.Bookmarks.Add Name:="temp", Range:=myRange
End If


Jeff

It's Time to get a gun.

That's what I've been thinkin.

I think I can afford one, If I do a little less Drinkin.

www.TrueGeeks.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform