+ Reply to Thread
Results 1 to 2 of 2

Switching between 2 word documents via excel VBA - Do I have to use ActiveDocument?

  1. #1
    Registered User
    Join Date
    11-12-2011
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    6

    Switching between 2 word documents via excel VBA - Do I have to use ActiveDocument?

    Hello all,
    I have a Userform that runs a macro that opens 2 separate word documents, a template letter and a letter with a few bookmarked text articles.

    I have been trying to get the macro to select a specific bookmark in the articles document based on the selection from a drop down box in the Userform, copy that bookmark, make the template letter the active document and paste the copies bookmark article text into a bookmark in the letter template.

    My question is: Is it necessary to have the macro switch between active Word documents to copy/paste text from one Word document to another or can you declare both documents as objects or documents and use the macro to copy/paste text between them without switching the active document?

    (If code is needed I can post it)

    Any help on this would be appreciated.
    Thanks
    K

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Switching between 2 word documents via excel VBA - Do I have to use ActiveDocument?

    You can declare both documents as Documents and copy/paste text between them without switching the active document. In fact this is the preferable way to do it.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA Transfer Data From Excel to Word and Keep Bookmarks in Word Documents
    By ShakJames in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-08-2015, 05:37 AM
  2. Excel to Word Documents
    By adamk03175 in forum Excel General
    Replies: 1
    Last Post: 03-17-2015, 05:52 PM
  3. Populating Word from excel and other word documents
    By Higham in forum Word Programming / VBA / Macros
    Replies: 2
    Last Post: 10-01-2013, 09:06 PM
  4. switching windows or documents with macro
    By sbraver in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-19-2013, 02:16 AM
  5. Linking word and excel documents
    By mozaic in forum Excel General
    Replies: 1
    Last Post: 10-31-2011, 01:32 PM
  6. switching between two open documents
    By bluec1512 in forum Excel General
    Replies: 3
    Last Post: 11-08-2007, 04:10 AM
  7. Replies: 2
    Last Post: 03-18-2005, 07:07 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1