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 insert a field like {page} ..

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





PostPosted: Mon Dec 01, 2003 10:06 am    Post subject: How to insert a field like {page} .. Reply with quote



Hi,
does anybody knows how to insert a field like {page} in
a current word document ?
Many thanks
Michael

Back to top
Glenn De Tollenaere
Guest





PostPosted: Thu Dec 04, 2003 9:18 am    Post subject: Re: How to insert a field like {page} .. Reply with quote



Hi Michael,

here is some code to insert a TOC-field (table of contents) in a
Worddocument:

procedure insert_toc_as_field(desc:string);

var
ole_range :range;
ole_text :olevariant;
ole_type :olevariant;
field :olevariant;

begin
ole_range:=worddoc.activewindow.selection.range;
ole_type:=wdfieldtoc;
ole_text:=desc;

field:=worddoc.selection.fields.add(ole_range,ole_type,ole_text,emptyparam);
end;

I guess the ole_type can help you to add other fields to your document
(worddoc is the document).

Regards
Glenn De Tollenaere
http://www.advosoft.be


"Michael Koop" <michael.koop (AT) planet-interkom (DOT) de> wrote

Quote:
Hi,
does anybody knows how to insert a field like {page} in
a current word document ?
Many thanks
Michael




Back to top
Michael Koop
Guest





PostPosted: Thu Dec 04, 2003 4:22 pm    Post subject: Re: How to insert a field like {page} .. Reply with quote



many thanks Glenn,
I will give it a try....
best regards
Michael


Glenn De Tollenaere schrieb:

Quote:
Hi Michael,

here is some code to insert a TOC-field (table of contents) in a
Worddocument:

procedure insert_toc_as_field(desc:string);

var
ole_range :range;
ole_text :olevariant;
ole_type :olevariant;
field :olevariant;

begin
ole_range:=worddoc.activewindow.selection.range;
ole_type:=wdfieldtoc;
ole_text:=desc;

field:=worddoc.selection.fields.add(ole_range,ole_type,ole_text,emptyparam);
end;

I guess the ole_type can help you to add other fields to your document
(worddoc is the document).

Regards
Glenn De Tollenaere
http://www.advosoft.be

"Michael Koop" <michael.koop (AT) planet-interkom (DOT) de> wrote in message
news:3FCB1292.93694218 (AT) planet-interkom (DOT) de...
Hi,
does anybody knows how to insert a field like {page} in
a current word document ?
Many thanks
Michael



Back to top
Michael Koop
Guest





PostPosted: Thu Dec 04, 2003 4:40 pm    Post subject: Re: How to insert a field like {page} ..IT WORKS ! Reply with quote

many,many,many thanks Glenn....it works....
..and now that I know what I have to look for,
I've found an interesting page with the word constants..
maybe you're interested too:
http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_20708855.html

best regards
Michael

Glenn De Tollenaere schrieb:

Quote:
Hi Michael,

here is some code to insert a TOC-field (table of contents) in a
Worddocument:

procedure insert_toc_as_field(desc:string);

var
ole_range :range;
ole_text :olevariant;
ole_type :olevariant;
field :olevariant;

begin
ole_range:=worddoc.activewindow.selection.range;
ole_type:=wdfieldtoc;
ole_text:=desc;

field:=worddoc.selection.fields.add(ole_range,ole_type,ole_text,emptyparam);
end;

I guess the ole_type can help you to add other fields to your document
(worddoc is the document).

Regards
Glenn De Tollenaere
http://www.advosoft.be

"Michael Koop" <michael.koop (AT) planet-interkom (DOT) de> wrote in message
news:3FCB1292.93694218 (AT) planet-interkom (DOT) de...
Hi,
does anybody knows how to insert a field like {page} in
a current word document ?
Many thanks
Michael



Back to top
Glenn De Tollenaere
Guest





PostPosted: Mon Dec 22, 2003 9:52 am    Post subject: Re: How to insert a field like {page} ..IT WORKS ! Reply with quote

Michael,

thanks for the link.
Also, all the constants used can be found in WORD_TLB if you import the
(Word) type library in your IDE.

Regards
Glenn


"Michael Koop" <michael.koop (AT) planet-interkom (DOT) de> wrote

Quote:
many,many,many thanks Glenn....it works....
.and now that I know what I have to look for,
I've found an interesting page with the word constants..
maybe you're interested too:

http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_20708855.html

best regards
Michael

Glenn De Tollenaere schrieb:

Hi Michael,

here is some code to insert a TOC-field (table of contents) in a
Worddocument:

procedure insert_toc_as_field(desc:string);

var
ole_range :range;
ole_text :olevariant;
ole_type :olevariant;
field :olevariant;

begin
ole_range:=worddoc.activewindow.selection.range;
ole_type:=wdfieldtoc;
ole_text:=desc;


field:=worddoc.selection.fields.add(ole_range,ole_type,ole_text,emptyparam);
end;

I guess the ole_type can help you to add other fields to your document
(worddoc is the document).

Regards
Glenn De Tollenaere
http://www.advosoft.be

"Michael Koop" <michael.koop (AT) planet-interkom (DOT) de> wrote in message
news:3FCB1292.93694218 (AT) planet-interkom (DOT) de...
Hi,
does anybody knows how to insert a field like {page} in
a current word document ?
Many thanks
Michael





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.