Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-23-2012, 05:58 PM
ubns ubns is offline Inserting Document and linking with previous section Windows 7 32bit Inserting Document and linking with previous section Office 2010 32bit
Competent Performer
Inserting Document and linking with previous section
 
Join Date: Apr 2012
Posts: 177
ubns is on a distinguished road
Default Inserting Document and linking with previous section

Sometime ago Paul assisted me with the code of inserting another document in a document (At the end).



The code is in this post.

Is it possible that when this document is inserted - it also do the following:

1) Remove the existing footer and replace it by linking it with previous section footer.
2) Add a specific bookmark to the heading of inserted document.

Code:
Sub insertdoc_essential()
Dim Scn As Section, HdFt As HeaderFooter
With ActiveDocument
  Set Scn = .Sections.Add(Range:=.Range.Characters.Last, Start:=wdSectionNewPage)
  With Scn
      For Each HdFt In Scn.Headers
      HdFt.LinkToPrevious = False
      .Range.Text = vbNullString
    Next
    For Each HdFt In Scn.Footers
      HdFt.LinkToPrevious = False
      .Range.Text = vbNullString
    Next
    .Range.InsertFile FileName:="p:\psk service agreements\client ongoing service agreement - Essentials.docx"
    While .Range.Characters.Last.Previous = vbCr
      .Range.Characters.Last.Previous.Delete
    Wend
  End With
End With
End Sub
Regards

Umesh Banga

Last edited by ubns; 08-24-2012 at 03:20 AM. Reason: na
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting one document into another Bluie Word 5 05-17-2012 12:00 PM
Inserting Document and linking with previous section Inserting a "Book Section" in the Bibliography of word 2007 tanababa Word 3 09-25-2011 03:41 AM
Margins in multiple section document oaty Word 0 08-15-2010 07:32 AM
Linking within the same document tam5070 Word 0 02-06-2009 02:21 PM
Same As Previous - changing default when inserting/pasting LdeMarais Word 0 09-21-2007 11:07 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:49 PM.


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