Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word Automation - Graphics in header
Message
From
24/07/2002 13:45:00
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Word Automation - Graphics in header
Miscellaneous
Thread ID:
00682166
Message ID:
00682166
Views:
62
Below is my attempt at putting a picture and some text into a header of a Word Document. What I have works. However, it does not generate the desired affect. What I wish to create is a header in which the graphic is left justified and the text is right justified. It is further complicated by the fact that part of the text ("Executive Summary") is to be on the same line as the Graphic. The dotted line and the "plans.customer" will be below the graphic. In the model created through word, the text "Executive Summary" is contained within a Textbox so we can move it anywhere we wish.
I tried to figure out how to insert a text box but have yet to be able to do that. Any help would be appreciated. Thanks.



oHeader = oDoc.Sections.Last.Headers[WdHeaderFooterPrimary]
oHeader.LinkToPrevious = .F.
oHeaderRange = oHeader.Range()
oHeaderRange.Text = ""
oShape = oDoc.InlineShapes.AddPicture("F:\SOMEPLACE\LOGOS\LOGO_CSR_BLACK.BMP",.f.,.t.,oHeaderRange)
oShape.Height = 45
oShape.Width = 95
oHeaderRange.InsertAfter("Executive Summary")
oHeaderRange.InsertAfter(CR)
oHeaderRange.InsertAfter("--------------------------------------------------------------------------------------------")
oHeaderRange.InsertAfter(CR)
oHeaderRange.InsertAfter(ALLTRIM(plans.customer))
oHeaderRange.ParagraphFormat.Alignment = wdAlignParagraphRight
oHeaderRange.Font.Name = FONT_NAME_STANDARD
oHeaderRange.Font.Size = FONT_SIZE_STANDARD_PLUS_ONE
oHeaderRange.Bold = 1
oHeaderRange.Collapse(wdCollapseEnd)
Next
Reply
Map
View

Click here to load this message in the networking platform