I'd like to copy the content of a word document at the the end of an another (which allready exists). Could somebody gimme the code please ?
Printable View
I'd like to copy the content of a word document at the the end of an another (which allready exists). Could somebody gimme the code please ?
The easiest way to get any code in Word is to use macro-recording. Set on recording, do what you want, and you have your code:
Standing in the open document.
And you're done.Code:Documents.Open FileName:="MyFile.doc" 'Opens the other document
Selection.WholeStory 'Selects all text
Selection.Copy 'Copy text
ActiveWindow.Close 'Closes that document
Selection.EndKey Unit:=wdStory 'Goes to the end of the 1st document
Selection.Paste 'Paste the text here
Thanks for the code, and for the advise ! Now I can go on. Thanks again.