Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Letters
Message
From
22/06/2001 11:28:30
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Miscellaneous
Thread ID:
00522504
Message ID:
00522515
Views:
8
>I am using Word 2000 in which I have created a document with bookmarks. Using the code from a FoxPro Advisor June 1996 article "Unleash the Power of OLE and Best-of-Breed Tools" by Michael P. Antonovich I am having a problem with the following. I first go to the bookmark of using the code WorkObj.EditGoTo(pcMarkName) and then using WordObj.Insert(pcFullName). The code work fine but doesn't place the pcFullName at the location of the bookmark. I retrieve the book defined in the word doc by pnCountMarks = WordObj.CountBookMarks and then store them in array. Any idea as to what could be happening here. It appears as those it is not actually go to the bookmark. When I open the word document and select from the insert bookmark menu and then select the bookmark with the goto button it does go to it. Any ideas.

Milt,
Since EditGoto is a word.basic command not word.application you shouldn't expect to behave as it did in old versions (I assume this is word.application). However it does if you include goto parameter (can't remember param position).
In word97 and up you shouldn't use word.basic commands because results are not the same as in prior versions. In word97 and up Bookmark is an object.
with oWord.ActiveDocument
 if .Bookmarks.Exists(tcBookmarkName)
      .Boookmarks(tcBookmarkName).Select
      With .Application.Selection
	.Collapse(wdCollapseEnd)  && Go to end of bookmark
*...
PS: Count - Bookmarks.Count. Also could use directly collection :
for each oBookmark in .Bookmarks
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform