>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)
PS: Count - Bookmarks.Count. Also could use directly collection :
for each oBookmark in .Bookmarks
Cetin