+ Reply to Thread
Results 1 to 4 of 4

paste from excel overwrites in Word document

  1. #1
    Forum Contributor
    Join Date
    01-25-2013
    Location
    near Philly, PA USA
    MS-Off Ver
    Excel 2019
    Posts
    178

    paste from excel overwrites in Word document

    I've a worksheet with blocks of text associated with a name on the same row.
    I'm searching for the name, then copying the block of text into a Word document.
    The loop works but it overwrites the prior text copied into the Word document.
    I tried an .InsertBreak but that didn't work.
    Help is appreciated!

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    12-31-2012
    Location
    Jhang, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: paste from excel overwrites in Word document

    Just replace your line 'AppWord.ActiveDocument.Content.Paste' with

    Please Login or Register  to view this content.
    then your code will be:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    01-25-2013
    Location
    near Philly, PA USA
    MS-Off Ver
    Excel 2019
    Posts
    178

    Re: paste from excel overwrites in Word document

    Thank you! That works great.
    Now, a problem I see now that it is working.
    I need to identify the name of the person (name1 or name2) the blocks of text pasted into the Word doc belong to.
    Right now, they all run one after another and I need to group them by name1 or name2 in the Word doc.
    I tried to paste name1 into the doc in the loop but either I got it repeated endlessly.
    Suggestions?

  4. #4
    Forum Contributor
    Join Date
    01-25-2013
    Location
    near Philly, PA USA
    MS-Off Ver
    Excel 2019
    Posts
    178

    Re: paste from excel overwrites in Word document

    I got the name to be inserted before the associated blocks of text.

    The output format in the Word document (attached) is in table cells all about the same size. Is there a way to resize the table cells in Word doc to fill available page width?


    Current code:
    Please Login or Register  to view this content.
    Thanks!
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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