Using vba to copy the contents of a word document into another word document

前端 未结 5 1184
谎友^
谎友^ 2020-12-16 22:04

I haven\'t used VB for years, so please forgive me if this turns out to be obvious. I\'m trying to write a word vba macro for use in a template which will display a userform

5条回答
  •  半阙折子戏
    2020-12-16 22:56

    Record a macro...

    1. start in the source document
    2. press ctrl-a to select everything
    3. press ctrl-c to copy it to the clipboard
    4. switch to the target document
    5. press ctrl-v to paste into the document
    6. stop recording

    or (assuming word 2007 or later)

    1. start in the target document with the source document closed
    2. on the ribbon click insert > object > Text from file...
    3. navigate to the source document
    4. click the insert button
    5. stop recording

    I prefer the second version so I should have put it first

提交回复
热议问题