View Single Post
 
Old 08-22-2019, 02:04 PM
A6c A6c is offline Windows 7 64bit Office 2013
Novice
 
Join Date: Aug 2019
Posts: 2
A6c is on a distinguished road
Default InsertFile footer does not appear

Hello,

I am experiencing an odd issue when using the following code to insert a document into another word document. When this code is ran on a document that has any text in it the footer present in letter.docx document does not appear. If there is no text in the open document, the file is inserted and the footer appears. I have unfortunately hit a road block trying to research this issue and what the best practice would be for this scenario. Would anyone be able to point me in the right direction?

Code:
stringID = Environ("Username")
   
    Selection.MoveUp Unit:=wdLine, Count:=75
    Selection.InsertFile FileName:="c:\macros\" & stringID & "\letter.docx", ConfirmConversions:=False, _
       Link:=False, Attachment:=False
With Selection.Font
        .Name = "Arial"
        .Size = 11


End With
    Selection.InsertDateTime DateTimeFormat:="MMMM d, yyyy", InsertAsField:= _
        False
    Selection.TypeParagraph
    Selection.TypeParagraph
Reply With Quote