Paste Range To End Of Word Document

  • Hello Excel gurus!


    I have a piece of code I've been compiling which ultimately I wish to perform the following actions:
    User enters numbers under quantity column *works fine
    Code copies items ordered to a temp worksheet *works fine
    Code copies entire range of temp worksheet *works fine
    Call word document template *works fine
    Set cursor to end of document *FAIL (object pastes over existing data)
    Paste selection *works fine
    Print Document *turned off until paste works correctly
    Save document to current date *works fine
    Close word *works fine
    Delete temp worksheet *works fine
    Reset quantity values *works fine


    utilizing this link: http://www.microsoft.com/techn…etips/may05/tips0519.mspx
    I incorporated the wdStory / wdMove scripts to move the cursor to the end of the document. still this had no effect and pastes the selection over the existing template.


    please advise of what action I am failing to turn on, or placing in the wrong location.


    THANK YOU!!!


  • Re: Copy Range And Paste At End Of Word Doc


    Since you add a document and then open a document, do you need to activate the document you opened:


    Code
    wrdDoc.Activate


    just prior to the With wrdDoc code?[hr]*[/hr] Auto Merged Post;[dl]*[/dl]The reason I say that is that I think it is trying to move the cursor on the blank document that you added. Then you specify the document you want the paste action to occur on.

  • Re: Copy Range And Paste At End Of Word Doc


    Mavyak,


    Thank you. I just tried to implement this, but it still over-writes the existing data.


    ...concerned that this may have something to do with being a document template vs. a normal word document.


    additional suggestions welcome!

  • Re: Paste Range To End Of Word Document


    Hello to Dave & ByTheCringe2
    while Mavyak appears to be the only intelligent member viewing this thread, I'd like to identify that


    1. (ByTheCringe2) there are NO abbreviations in this thread title: "Paste Range To End Of Word Document"


    2. (Dave) this is an Excel coding issue - I am running a script within EXCEL to call Word for a moment and need directives that Excel and tell Word how, what and where, I am not embedding vba code into Word for Excel to open and run.


    have a great day!

  • Re: Paste Range To End Of Word Document


    Quote

    . (ByTheCringe2) there are NO abbreviations in this thread title: "Paste Range To End Of Word Document"

    Now that's not very intelligent! Your orginal thread title, with the abbreviation, can be seen directly below your 1st post. The one you are quoting, is the edited one.


    Quote

    2. (Dave) this is an Excel coding issue - I am running a script within EXCEL to call Word for a moment and need directives that Excel and tell Word how, what and where, I am not embedding vba code into Word for Excel to open and run.

    Another statement in ignorance. The Word forum description clearly shows; "Only for questions that pertain to Word and Excel, or Word only." You WERE even shown the forums, along with descriptions, before you started your thread. However, in your defense, the rules you agreed to, do assume an IQ greater than room temperature.


    I suggest that you leave our forum and find another place. Watch the door doesn't hit you in the ....... on the way out :)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!