Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, i am trying to control Word from a Excel macro so that i can
create a document from infomation on the spreadsheet. My problem is i am having problems setting up the headers and footers. Please can you advise me on the following code, Thanks Oggy ' Send commands to Word Dim wrdApp As Word.Application Dim doc As Word.Document Dim rngDoc As Word.Range Set wrdApp = CreateObject("Word.Application") wrdApp.Visible = True Set doc = wrdApp.Documents.Add ' create a new document Set rngDoc = doc.Content Dim HdFt As HeaderFooter Set HdFt = doc.Sections(1).Headers(wdHeaderFooterFirstPage) With WordApp With HdFt .Text = "Left side" & vbTab & "Center" & vbTab & "right side" End With With rngDoc .Font.Name = "Times New Roman" .Font.Size = 10 .Font.Bold = False .Font.Italic = False .ParagraphFormat.Alignment = 1 .Text = "QUOTATION" & vbCr End With End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Setting up Default Headers/Footers in Excel | Excel Discussion (Misc queries) | |||
Importing Excel report into Word showing headers and footers | Excel Discussion (Misc queries) | |||
Setting the Headers and Footers in Excel 2007 when exporting Information from Cobol program | Excel Programming | |||
Export Entire Excel Sheet with headers, footers, etc, to Word | Excel Programming | |||
Excel Headers & Footers | Excel Programming |