Author: Bill - Work email
Posted: 2001-05-16 at 16:06:28
Brian -
Do you have a method for identifying (so that you can cycle through them)
all the bookmarks on a given document?
Ideal would be a way to load them into an array from whatever container
holds them in the document.
Thanks,
-Bill
----- Original Message -----
From: <Brian.Searle@indsys.ge.com>
To: "Multiple recipients of ProFox" <profox@leafe.com>
Sent: Wednesday, May 16, 2001 1:27 PM
Subject: RE: Word Headers
> Ken,
>
> I spent a lot of time on an application using Word 97 last year. I know
how
> frustrating it can be to use the Object Browser in Word and convert VB
> constants to VFP equivalents.
>
> I've included some code to show how I set up a header for a first page
with a
> different one for the remaining pages.
>
> *-- Word header example
> oWord = CREATEOBJECT("Word.Application")
> oWord.CAPTION = "My Word Document"
> oDoc = oWord.documents.ADD()
> oWord.ActiveWindow.ActivePane.VIEW.TYPE = 3 && Set to page view
> oWord.VISIBLE = .T.
> oWord.WINDOWSTATE = 1
>
> *-- Set the page margins
> WITH oDoc.PageSetup
> .TopMargin = 20
> .BottomMargin = 40
> .LeftMargin = 57.5
> .RightMargin = 20
> ENDWITH
>
> *-- Set the header information for the top of each page
> oWord.ActiveWindow.ActivePane.VIEW.SeekView = 9
>
> WITH oWord.SELECTION
> .ParagraphFormat.TabStops.ClearAll
> .ParagraphFormat.ALIGNMENT = 0
> .ParagraphFormat.TabStops.ADD(380)
> .TypeText(CHR(13)+CHR(13)+CHR(13))
> .FONT.NAME = "Times New Roman"
> .FONT.SIZE = 16
> .FONT.BOLD = .T.
> .FONT.ITALIC = .T.
> .TypeText(CHR(9)+"My Logo")
> .HeaderFooter.Shapes.AddLine(58, 94, 461, 94)
> * .HeaderFooter.Shapes.AddPicture(sys(5)+"mylogo.gif")
> .TypeText(CHR(13))
> ENDWITH
>
> oWord.ActiveWindow.ActivePane.VIEW.SeekView = 0
> oWord.ActiveWindow.ActivePane.VIEW.SeekView = 9
>
> WITH oWord.SELECTION
> .PageSetup.DifferentFirstPageHeaderFooter = .T.
> .ParagraphFormat.TabStops.ClearAll
> .ParagraphFormat.ALIGNMENT = 0
> .ParagraphFormat.TabStops.ADD(380)
> .TypeText(CHR(13)+CHR(13)+CHR(13))
> .FONT.NAME = "Times New Roman"
> .FONT.SIZE = 16
> .FONT.BOLD = .T.
> .FONT.ITALIC = .T.
> .TypeText(CHR(9)+"My Logo")
> .HeaderFooter.Shapes.AddLine(58, 94, 461, 94)
> * .HeaderFooter.Shapes.AddPicture(sys(5)+"mylogo.gif")
> .TypeText(CHR(13))
> .FONT.SIZE = 8
> .FONT.BOLD = .F.
> .FONT.ITALIC = .F.
> .TypeText(CHR(13))
> .TypeText(CHR(9)+"First page info only")
> .TypeText(CHR(13))
> ENDWITH
>
> oWord.ActiveWindow.ActivePane.VIEW.SeekView = 0
>
> WITH oWord.SELECTION
> .InsertBreak(7)
> .TypeText(CHR(9)+"Some stuff on another page")
> ENDWITH
>
> In the case that it matters, this runs using VFP6 SP4 and Word 97 (it
works in
> 2000 as well).
> HTH
>
> Brian Searle
> brian.searle@indsys.ge.com
>
>
> > -----Original Message-----
> > From: Teague Ken Contr ESC/XP [mailto:Ken.Teague@hanscom.af.mil]
> > Sent: Wednesday, May 16, 2001 10:54 AM
> > To: Multiple recipients of ProFox
> > Subject: Word Headers
> >
> >
> >
> > In creating a word document via automation I need to create
> > one header for
> > the first page, then a different header for the subsequent
> > pages. Do anyone
> > have code that I can use as guide to create?
> >
> >
> > Ken.Teague@Hanscom.AF.MIL
> >
> >
> >
> >
> > >
>
>