Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word Auto: trouble with .GoTo a Bookmark in Word
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01310785
Message ID:
01310911
Views:
11
Hi Yuri,

The bookmarkID worked but in the end, the GoTo() method only moves the *range* to that point and does not visually move the insertion point (although that might be workable, it's not what my wrapper function is trying to do). It seems that I have to instead use the .Select() method of the bookmark to move to and select the bookmark i.e.
loBookmark = loDocument.Bookmarks.ItemID(tcBookmarkName)
loBookmark.Select()
This has the "down side" of actually selecting the bookmark which may prove to be troublesome but I will have to work with it for now.

On another note, one of your lines of code needs fixing up a bit (and it is also wrong in the book I am using, it seems, so it seems to be a common mistake). This:
oWord.Selection.GoTo(wdGoToBookmark,,,tcBookmarkName)

* should be:

oWord.Application.Selection.GoTo(wdGoToBookmark,,tcBookmarkName)
(just in case some one else reads this thread. At least, I could not get it to work any other way).

Albert
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform