Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Jumping to a Bookmark in Word
Message
From
11/06/2002 12:59:37
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00666768
Message ID:
00667002
Views:
22
>>As Cetin showed you, you can access a bookmark directly, but you probably don't even need the Select syntax he showed. If, for example, you want to replace the text at a bookmark, you can just do it this way:
>>
>>oDocument.Bookmarks("YourBookmark").Range.Text = "Put this text at the bookmark."
>>
>>In general, you rarely need to select something in Word in order to work with it.
>>
>>Tamar
>
>Thanks Tamar, but I need to jump to a specific location in the document to insert documents and tables.

In fact, you still don't need to select anything to do that. If the idea is to insert something at the bookmark position, you can do it like this:


oRange = oDocument.Bookmarks("YourBookmark".Range()

* To insert a table at that position, use:
oDocument.Tables.Add(oRange, nRows, nColumns)

* To insert another file at that position, use:
oDocument.InsertFile("MyOtherFile.DOC",oRange)

and so on.

Tamar
Previous
Reply
Map
View

Click here to load this message in the networking platform