View Single Post
 
Old 01-11-2014, 04:51 AM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

That suggests the document to which this applies might not be the first one to be opened. Allowing for that possibility -

On the end of:
Dim StrFlds As String, i As Long
add:
, Rng As Range

After:
Set wdTgtDoc = ActiveDocument
insert:
Set Rng = wdTgtDoc.Characters.Last

Change:
wdTgtDoc.Range.InsertAfter .FormFields(4).Result & vbCr
to:
Code:
    If .Name = "Form1.doc" Then
      Rng.InsertBefore .FormFields(1).Result & vbCr & .FormFields(4).Result & vbCr
    Else
      wdTgtDoc.Range.InsertAfter .FormFields(4).Result & vbCr
    End If
and replace "Form1.doc" with whatever the document's name should be.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote