-
Basically, this code deletes the header from the section 2, but keeps the style from the section 1.
[VBA]With Selection
.EndKey Unit:=wdStory
.InsertBreak Type:=wdSectionBreakNextPage
.InsertFile FileName:="C:\Documents and Settings\lorien\My Documents\zen.doc", Range:=""
End With
Dim oSec As Section
Dim sPrintCode As String
For Each oSec In ActiveDocument.Sections
sPrintCode = sPrintCode & oSec.Range.Information(wdActiveEndPageNumber) & ","
Next
sPrintCode = Left(sPrintCode, Len(sPrintCode) - 1)
ActivePrinter = "Jingo2"
Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:=sPrintCode, PageType:= _
wdPrintAllPages, ManualDuplexPrint:=False, Collate:=True, Background:= _
True, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, _
PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0
End Sub [/VBA]
Since this code does the job well, is there a way to incorporate saving style of section 2 (inserted document) in it?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules