#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
If you are inserting a document which footer will remain? A page cannot have two footers.
One possible workaround is before inserting the document insert a section break next page and unlink headers / footers, but doing this inserted document will be in a new page not continuous text.
__________________
Backup your original file before doing any modification. |
#3
|
||||
|
||||
Which behaviour do you want? The original header/footers or the imported ones.
It sounds like Word is being clever and importing the header/footer when the file is blank. An easy fix would be to either put the date in first (so the file isn't empty) or import the content without any section breaks or the final paragraph mark.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#4
|
|||
|
|||
I would like the imported document's footer
|
Tags |
footer, vba |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Saving information into Footer doesn't close footer | Ken Leidner | Word VBA | 2 | 07-13-2018 12:34 PM |
InsertFile() with literature reference | texMan | Word VBA | 3 | 04-18-2018 02:18 AM |
Footer - more then one footer (auto fill text in slides) | noodle | PowerPoint | 0 | 03-31-2013 04:50 AM |
range.insertfile produces diff result between word 2010 and 2007 | rsmedley | Word | 1 | 02-15-2012 10:48 PM |
Header/Footer lost with InsertFile | cksm4 | Word VBA | 2 | 03-07-2011 06:09 PM |