Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word Automation - Drop Header after First Page
Message
From
26/07/2002 12:27:02
 
 
To
26/07/2002 10:16:13
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00682717
Message ID:
00683056
Views:
20
I have managed to remove the header from all but the first page of the section. The Code below accomplishes that. I now am faced with the problem of the BLANK HEADER keeping its spot at the top of the page. I wish for the text to move up since the header is gone. I have tried various things to no avail. Any ideas on that ?





oDoc.Sections.Last.PageSetup.DifferentFirstPageHeaderFooter = .T.
oHeaderPrimary = oDoc.Sections.Last.Headers[wdHeaderFooterPrimary]
oHeaderPrimary.LinkToPrevious = .F.
oHeaderPrimary.Range.Text = ''
oHeaderPrimary.Exists = .F.


oHeaderFirstPage = oDoc.Sections.Last.Headers[WdHeaderFooterFirstPage]
oHeaderFirstPage.LinkToPrevious = .F.
oHeaderFirstPage.Range.Text = ""
oHeaderFirstPageRange = oHeaderFirstPage.Range()

oTable = oDoc.Tables.Add(oHeaderFirstPageRange,1,2,1,2)
oTable.Borders.OutsideLineStyle= 0 && wdLineStyleNone
oTable.Borders.InsideLineStyle=0
oCellRange = oTable.Cell[1,1].Range()
oCellRange.ParagraphFormat.Alignment = wdAlignParagraphLeft
oShape = oDoc.InlineShapes.AddPicture("F:\SOMEPLACE\LOGOS\LOGO_XXX_BLACK.BMP",.f.,.t.,oCellRange)
oShape.Height = 72
oShape.Width = 152

oCellRange = oTable.Cell[1,2].Range()
oCellRange.InsertAfter(+CR+CR)
oCellRange.InsertAfter("Executive Summary")
oDoc.TablesOfContents.MarkEntry(oRange,"Executive Summary")


oCellRange.Font.Size = 16
oCellRange.Font.Bold = FONT_BOLD_YES
oCellRange.ParagraphFormat.Alignment = wdAlignParagraphRight
oHeaderFirstPageRange.Collapse(wdCollapseEnd)

oHeaderFirstPageRange.Font.Size = 8
oHeaderFirstPageRange.ParagraphFormat.Alignment = wdAlignParagraphCenter
oHeaderFirstPageRange.InsertAfter(CR)
FOR j = 1 TO 39
oHeaderFirstPageRange.InsertAfter(CHR(151))
ENDFOR
oHeaderFirstPageRange.InsertAfter(CR)
oHeaderFirstPageRange.Collapse(wdCollapseEnd)


oHeaderFirstPageRange.InsertAfter(ALLTRIM(plans.customer))
oHeaderFirstPageRange.ParagraphFormat.Alignment = wdAlignParagraphRight
oHeaderFirstPageRange.Font.Name = FONT_NAME_STANDARD
oHeaderFirstPageRange.Font.Size = FONT_SIZE_STANDARD_PLUS_ONE
oHeaderFirstPageRange.Bold = 1
oHeaderFirstPageRange.Collapse(wdCollapseEnd)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform