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 

Word and Bookmarks

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
John Greco
Guest





PostPosted: Fri Aug 19, 2005 4:34 pm    Post subject: Word and Bookmarks Reply with 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
Nikolay
Guest





PostPosted: Sun Aug 21, 2005 7:23 am    Post subject: Re: Word and Bookmarks Reply with quote




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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation 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.