BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to use Bookmark with Word application

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder
View previous topic :: View next topic  
Author Message
de_ouwe
Guest





PostPosted: Tue Jun 07, 2005 11:33 am    Post subject: How to use Bookmark with Word application Reply with quote



Hello,
It seems that I'm almost alone with using TWordApplication in Borland
CPP Builder. I'm trying to work with the following code:

TWordApplication *wrd_app;
TWordDocument *wrd_doc;



void GoBookmarkText(AnsiString asBookmark, AnsiString asText)
{
if (wrd_doc->Bookmarks->Exists(TVariant(asBookmark.c_str()))) {
RangePtr *ppRange;
if (wrd_app->Selection->GoTo(&TVariant(wdGoToBookmark),
EmptyParam, EmptyParam, &TVariant(asBookmark.c_str()), ppRange)) {
if (ppRange) {
(*ppRange)->InsertAfter(WideString(asText));
}
}
}
}
Sometimes it works, sometimes I am getting an error in the InsertAfter
line.
What is wrong, looking on the internet I found very little information
about working with Word from Borland.

Maybe I have to try something else, any suggestion is welkom.

Thanks in advange.

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.