 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
John Greco Guest
|
Posted: Fri Aug 19, 2005 4:34 pm Post subject: Word and Bookmarks |
|
|
I am trying to fill in the bookmarks in the word document. However I am
getting the following error:
Method 'Size' not supported by automation object.
What I am trying to do is the following:
Doc := WordApp.ActiveDocument;
if Doc.Bookmarks.Exists(bookmarkarray[z,k]) then
begin
bookmark := Doc.Bookmarks.Item(bookmarkarray[z,k]).Range;
Inc(k);
bookmark.InsertAfter(bookmarkarray[z,k]);
bookmark.Bold := 0;
bookmark.Size := 11; //<-- This is what is throwing the error.
k := 1;
end;
Anyone have any ideas on how to get it to work? I just want to make sure
that whatever is written in word is all the same size.
Thanks.
--
John Greco
johng at cashea dot com
|
|
| Back to top |
|
 |
Nikolay Guest
|
Posted: Sun Aug 21, 2005 7:23 am Post subject: Re: Word and Bookmarks |
|
|
I tink what you try to do is to encapsulate the text you are writing in a bookmark.
If that is so here is the way:
1. When you insert a text youo should select the bookmark
bookmarks.item(x).select;
2. Use the insert property of the selection object
selection.insert(text);
3. make the bookmark's end_ property to be equal to the selection.start property
bookmarks.item(t).end_:-selection.start;
Nikolay
John Greco <johng (AT) cashea (DOT) com> wrote:
| Quote: | I am trying to fill in the bookmarks in the word document. However I am
getting the following error:
Method 'Size' not supported by automation object.
What I am trying to do is the following:
Doc := WordApp.ActiveDocument;
if Doc.Bookmarks.Exists(bookmarkarray[z,k]) then
begin
bookmark := Doc.Bookmarks.Item(bookmarkarray[z,k]).Range;
Inc(k);
bookmark.InsertAfter(bookmarkarray[z,k]);
bookmark.Bold := 0;
bookmark.Size := 11; //<-- This is what is throwing the error.
k := 1;
end;
Anyone have any ideas on how to get it to work? I just want to make sure
that whatever is written in word is all the same size.
Thanks.
--
John Greco
johng at cashea dot com
|
|
|
| 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
|
|