M
michmill1973
Hello,
I have a macro that opens a document, selects the text and then copies
it at the top of the active document, which works well to copy the
body text, but I can't work out how to also copy the header and
footer. The header contains an image and the footer text.
Below is what I currently have:
Dim strFileName As String
strFileName = "C:\Fax Header Source.doc"
Documents.Open (strFileName)
Dim rngHeaderText As Range
Set rngHeaderText = ActiveDocument.Content
With rngHeaderText
.Copy
End With
ActiveDocument.Close (wdDoNotSaveChanges)
With ActiveDocument
Selection.HomeKey Unit:=wdStory
End With
Selection.PasteAndFormat (wdPasteDefault)
Any advice on how to also copy the header and footer will be greatly
appreciated!
Regards
Michelle M
I have a macro that opens a document, selects the text and then copies
it at the top of the active document, which works well to copy the
body text, but I can't work out how to also copy the header and
footer. The header contains an image and the footer text.
Below is what I currently have:
Dim strFileName As String
strFileName = "C:\Fax Header Source.doc"
Documents.Open (strFileName)
Dim rngHeaderText As Range
Set rngHeaderText = ActiveDocument.Content
With rngHeaderText
.Copy
End With
ActiveDocument.Close (wdDoNotSaveChanges)
With ActiveDocument
Selection.HomeKey Unit:=wdStory
End With
Selection.PasteAndFormat (wdPasteDefault)
Any advice on how to also copy the header and footer will be greatly
appreciated!
Regards
Michelle M