![]() |
#1
|
|||
|
|||
![]()
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 Umesh Banga Last edited by ubns; 08-24-2012 at 03:20 AM. Reason: na |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Inserting one document into another | Bluie | Word | 5 | 05-17-2012 12:00 PM |
![]() |
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 |