Author: Cindy Winegarden
Posted: 2001-05-20 at 22:56:16
JK,
I do a lot of SQL Pass-through involving the use of internal quotes.
Brackets solve so many problems that I began using them everywhere.
Consider the following:
cMySQL = ;
[SELECT * FROM MyTable ] + ;
[WHERE MyField = "Adam's Apple" ]
Cindy Winegarden MCSD, MVP
cindy.winegarden@mvps.org
-----Original Message-----
From: profox@leafe.com [mailto:profox@leafe.com] On Behalf Of John
Koziol
Sent: Sunday, May 20, 2001 10:32 PM
To: Multiple recipients of ProFox
Subject: RE: Word Automation/Bookmarks (was Word Headers)
OK, I'm gonna assume there is a compelling reason for the brackets in
place of the normal quotes.... ;-)
-----Original Message-----
From: profox@leafe.com [mailto:profox@leafe.com]On Behalf Of Cindy
Winegarden
Sent: Sunday, May 20, 2001 8:08 PM
To: Multiple recipients of ProFox
Subject: RE: Word Automation/Bookmarks (was Word Headers)
Bill and Brian,
Forgive me if this has been answered already. There is a bookmarks
collection in the Word object model. Then you can use code like:
oWord = CREATEOBJECT([Word.Application])
oWord.Visible = .T.
oDocument = oWord.Documents.Add([MyDoc.DOC])
*!* Assume you've got some bookmarks in this document
FOR EACH oBookmark IN oDocument.Bookmarks
oBookmark.Select()
ENDFOR
Cindy Winegarden MCSD, MVP
cindy.winegarden@mvps.org
-----Original Message-----
From: profox@leafe.com [mailto:profox@leafe.com] On Behalf Of Bill -
Work email
Sent: Wednesday, May 16, 2001 4:06 PM
To: Multiple recipients of ProFox
Subject: Word Automation/Bookmarks (was Word Headers)
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