For lngZ = 1 To lngRecs strTempDoc = Tempset("FileName") If lngZ = 1 Then objWord.Documents.Add (strTempDoc) ' for the first document to be added use Documents.Add method Selection.MoveEnd Unit:=wdLine, Count:=1 Else bX = InsertFile(strTempDoc, Range, ConfirmConversions, Link, Attachment) Selection.MoveEnd Unit:=wdLine, Count:=1 End If ' intGG = Instance.EndKey(Unit:=6) '''' here ' Selection.EndKey Unit:=wdStory, Extend:=wdMove Tempset.MoveNext If Tempset.EOF Then Exit For End If Next
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)