Results 1 to 3 of 3

Thread: Question on VBA for Word.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Posts
    21

    Question

    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 ?

  2. #2
    Lively Member
    Join Date
    May 2000
    Location
    Norway
    Posts
    112
    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.
    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
    And you're done.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Posts
    21

    Talking

    Thanks for the code, and for the advise ! Now I can go on. Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width