Hi,
i've got several ranges in my document which i want to export into a new word document. However when ever i paste into the new document it simply overwrites the previous entry. What am i doing wrong please?
This code is called from another looping function so startbm and endbm change each time eg start1, start3, start5
Set oRange = aDoc.Range(Start:= _
aDoc.Bookmarks(startBM).End, _
End:=aDoc.Bookmarks(endBM).Start)
oRange.Copy
If m_ObjDocument Is Nothing Then
Set m_ObjDocument = Documents.Add
End If
m_ObjDocument.Activate
Selection.EndKey Unit:=wdStory
m_ObjDocument.Range.Paste
i only ever end up with one range pasted into the new document.
I'm sure its an easy fix but I've battled it for ages and can't see what am i doing wrong.
i've got several ranges in my document which i want to export into a new word document. However when ever i paste into the new document it simply overwrites the previous entry. What am i doing wrong please?
This code is called from another looping function so startbm and endbm change each time eg start1, start3, start5
Set oRange = aDoc.Range(Start:= _
aDoc.Bookmarks(startBM).End, _
End:=aDoc.Bookmarks(endBM).Start)
oRange.Copy
If m_ObjDocument Is Nothing Then
Set m_ObjDocument = Documents.Add
End If
m_ObjDocument.Activate
Selection.EndKey Unit:=wdStory
m_ObjDocument.Range.Paste
i only ever end up with one range pasted into the new document.
I'm sure its an easy fix but I've battled it for ages and can't see what am i doing wrong.