Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-22-2019, 02:04 PM
A6c A6c is offline InsertFile footer does not appear Windows 7 64bit InsertFile footer does not appear Office 2013
Novice
InsertFile footer does not appear
 
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
  #2  
Old 08-22-2019, 05:07 PM
eduzs eduzs is offline InsertFile footer does not appear Windows 10 InsertFile footer does not appear Office 2010 32bit
Expert
 
Join Date: May 2017
Posts: 260
eduzs is on a distinguished road
Default

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.
Reply With Quote
  #3  
Old 08-23-2019, 05:43 AM
Guessed's Avatar
Guessed Guessed is offline InsertFile footer does not appear Windows 10 InsertFile footer does not appear Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Reply With Quote
  #4  
Old 08-26-2019, 05:54 AM
A6c A6c is offline InsertFile footer does not appear Windows 7 64bit InsertFile footer does not appear Office 2013
Novice
InsertFile footer does not appear
 
Join Date: Aug 2019
Posts: 2
A6c is on a distinguished road
Default

I would like the imported document's footer
Reply With Quote
Reply

Tags
footer, vba

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
InsertFile footer does not appear 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
InsertFile footer does not appear range.insertfile produces diff result between word 2010 and 2007 rsmedley Word 1 02-15-2012 10:48 PM
InsertFile footer does not appear Header/Footer lost with InsertFile cksm4 Word VBA 2 03-07-2011 06:09 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft