 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
George Kuascha Guest
|
Posted: Sat Sep 03, 2005 9:45 pm Post subject: WORD Page numbers |
|
|
I'm having a problem creating a format PAGE # of PAGENUMBERS in a footer. My
code is shown below. I'm trying to print in this format PAGE 1 OF 2. It
comes out PAGE OF center on one line and 12 left justified on the next line.
Can someone tell me what is wrong with this code?
Type_1:= wdFieldPage;
Type_2:= wdFieldNumPages;
Text:= '';
PreserveFormatting:= true;
WordDocument1.ActiveWindow.Selection.InsertParagraph;
FR:= WordDocument1.ActiveWindow.Selection.Range;
FR.Collapse(Direction);
WordDocument1.ActiveWindow.Selection.Paragraphs.Alignment:=
wdAlignParagraphCenter;
WordDocument1.ActiveWindow.Selection.TypeText('PAGE ');
WordDocument1.ActiveWindow.Selection.Fields.Add(FR,Type_2,Text,PreserveForma
tting);
WordDocument1.ActiveWindow.Selection.TypeText(' OF ');
WordDocument1.ActiveWindow.Selection.Fields.Add(FR,Type_1,Text,PreserveForma
tting);
WordDocument1.ActiveWindow.ActivePane.View.SeekView:= wdSeekMainDocument;
|
|
| Back to top |
|
 |
George Kuascha Guest
|
Posted: Sun Sep 04, 2005 1:28 pm Post subject: Re: WORD Page numbers |
|
|
I finally figured out that I needed to collapse before adding the fields.
"George Kuascha" <gkhokie (AT) hotmail (DOT) com> wrote
| Quote: | I'm having a problem creating a format PAGE # of PAGENUMBERS in a footer.
My
code is shown below. I'm trying to print in this format PAGE 1 OF 2. It
comes out PAGE OF center on one line and 12 left justified on the next
line.
Can someone tell me what is wrong with this code?
Type_1:= wdFieldPage;
Type_2:= wdFieldNumPages;
Text:= '';
PreserveFormatting:= true;
WordDocument1.ActiveWindow.Selection.InsertParagraph;
FR:= WordDocument1.ActiveWindow.Selection.Range;
FR.Collapse(Direction);
WordDocument1.ActiveWindow.Selection.Paragraphs.Alignment:=
wdAlignParagraphCenter;
WordDocument1.ActiveWindow.Selection.TypeText('PAGE ');
WordDocument1.ActiveWindow.Selection.Fields.Add(FR,Type_2,Text,PreserveForma
tting);
WordDocument1.ActiveWindow.Selection.TypeText(' OF ');
WordDocument1.ActiveWindow.Selection.Fields.Add(FR,Type_1,Text,PreserveForma
tting);
WordDocument1.ActiveWindow.ActivePane.View.SeekView:=
wdSeekMainDocument;
|
|
|
| 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
|
|