+ Reply to Thread
Results 1 to 4 of 4

Macro to copy and paste from another Word 2007 document.

  1. #1
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Macro to copy and paste from another Word 2007 document.

    I will try to explain what I am trying to accomplish. We have a network in our section and all using Word 2007.
    We are set up that a main Admin (Me) will create templates in Word that will need to have macros that will search in a specific folder and open another word document so that it could copy and paste the entire document, including header/footer, and paste this information in the current blank word document.

    I have a Userform with three selections that, base on the selection will call different document template. I have set up also my machine to have the macro in my Quick Access Toolbar.

    I need that everytime a user opens his her word 2007, on his her station, be able to have this Quick Access Toolbar and that on selection my Userform and codes will do the rest.
    I have read on Add-in’s but do not know where to start... Is there a way I could distribute this macro to all of my users? Or is this a security issue?

    Next Part is copying all of the text, including header/footer, of a document and pasting this info in the blank document. So example the user will open Word 2007 (Blank document) select my macro in the Quick Access Toolbar, then on selection of this button it will open a userform that will have a combobox with three selection, then on click of a selection, it will get the information from where I will set up the path, paste the information in the blank document and close the other Worddoc.

    What would be the best approach in vba to do this?

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,830

    Re: Macro to copy and paste from another Word 2007 document.

    Quote Originally Posted by Excelnoub View Post
    We are set up that a main Admin (Me) will create templates in Word that will need to have macros that will search in a specific folder and open another word document so that it could copy and paste the entire document, including header/footer, and paste this information in the current blank word document.
    I don't understand why you'd do that rather than either: (a) using a template that already has the required base content; or (b) simply making a copy of the other document, then opening the copy.

    Perhaps you could explain.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: Macro to copy and paste from another Word 2007 document.

    In our process, in house, we have over 8 standard templates that we use every day. Most of them, the template, are being used daily. Therefore on my MS word I have set up a main template, blank page MS word document that I only need to open and, in my quick access toolbar, I have a button that I added that calls a Userform with selection. When I have a requirement, I only have to choose the proper template name and in my VB Code, it opens the document, but not the footer/header. That is one thing.

    I am trying to be more productive, that and higher power asked me if there would be a better way to retrieve these templates to be more pro-active. I mean don't get me wrong, doing a copy and paste is more than enough for me as I am quick on my feet, and fingers, but THEY think it could be more efficient if other users would not need to open a template every time by going through the network...opening a document, copying the document, opening a blank document, pasting the copied document and then closing the template document.

    I mean for them it 5 seconds of waste of time... for me it daily routine...lol

    On that note I think I found my answer, well half, cause I still need to make sure the header and footer are also copied, I will just transfer my blank template with the Userform and also the Quick Access Toolbar button and save it to the network where the people will only need to open my Blank document and have to make a copy and paste of the document itself.

    But I am all up for if there is an even faster way... instead of doing 20 documents a day I will be able to make 22 lol and that is more production where I am

  4. #4
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,830

    Re: Macro to copy and paste from another Word 2007 document.

    As I said, given that you know what document you want to copy everything from, it would be more efficient to make a copy of that document, then open the copy than to create a new document, open the existing one, copy the content, paste it into the new document, then close the existing one - especially since an ordinary copy/paste won't necessarily pick up header/footer contents. An alternative would be to make the existing document read-only (e.g. by storing it in a read-only location), open that, allow the user to do their edits, then they'll only be able to save via Save As to a new location. Either approach is far more efficient than the process you've outlined.

+ 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. Make a copy of a word document and paste it in a different folder with a name 'Test'
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-08-2013, 01:09 PM
  2. 2007 excel and 2007 word copy/paste
    By rkitson in forum Excel General
    Replies: 0
    Last Post: 02-19-2013, 02:34 PM
  3. Copy data from Excel and paste it in a table in word document
    By shekhar in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-04-2012, 05:28 AM
  4. Copy and paste from Excel 2007 to Word 2007
    By chuckied in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-01-2010, 08:20 PM
  5. Replies: 1
    Last Post: 10-17-2005, 04:05 AM

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