copy a whole one page document and do sth, then paste it back to the end of it

Y

YiShusen

Hi

I have a one page document with bookmarks on it. I can do just
replacement of those bookmarks once. But if I want to do it several
times, my approach is as:

1, copy the document template on to clipboard,
2, do replacement of the bookmarks once,
3, paste the thing to the end of the document
4, go to step 1 till finished

I have problem in step 1 and 3. you help will be highly appreciated,
thank you.
 
D

Doug Robbins - Word MVP

From where is the data coming that is going to be used to replace the
bookmarks? Maybe you should be using mailmerge and execute the merge to a
new document.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
Y

YiShusen

Thank you Greg and Doug.

Could any of you just tell me how to copy a whole word document and
paste to the end of the same ducument?
 
D

Doug Robbins - Word MVP

ActiveDocument.Range.InsertAfter ActiveDocument.Range

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
Y

YiShusen

Thank you all for response. I figured it out myself. if you are
intereted what I did, plesr read:

Selection.WholeStory
Selection.Copy
while condition is true
replace bookmarks
Selection.EndKey Unit:=wdStory, Extend:=wdMove
Selection.Paste
end while

'undo the last paste
ActiveDocument.Undo
'move cursor up
Selection.TypeBackspace
'clean Clipboard******************
Dim MyData As DataObject
Set MyData = New DataObject
MyData.SetText ""
MyData.PutInClipboard
'end of clean Clipboard******************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top