 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Michael Koop Guest
|
Posted: Mon Dec 01, 2003 10:06 am Post subject: How to insert a field like {page} .. |
|
|
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
|
Posted: Thu Dec 04, 2003 9:18 am Post subject: Re: How to insert a field like {page} .. |
|
|
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
|
Posted: Thu Dec 04, 2003 4:22 pm Post subject: Re: How to insert a field like {page} .. |
|
|
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
|
Posted: Thu Dec 04, 2003 4:40 pm Post subject: Re: How to insert a field like {page} ..IT WORKS ! |
|
|
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
|
Posted: Mon Dec 22, 2003 9:52 am Post subject: Re: How to insert a field like {page} ..IT WORKS ! |
|
|
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 |
|
 |
|
|
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
|
|