 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
de_ouwe Guest
|
Posted: Tue Jun 07, 2005 11:33 am Post subject: How to use Bookmark with Word application |
|
|
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 |
|
 |
|
|
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
|
|