views:

27

answers:

1

Hi,

I have been trying to copy text from excel in to word, and retain the bold formatting on the text, but not the cell. When I try manually copy and paste over a cell the text is copied but not the cell itself. When I try repeat this using vb (as shown below) the cell is also copied over

With wrdDoc

    .Content.Font.Name = "Times New Roman"
    .Content.Font.Size = 11
    .Content.InsertParagraphAfter
    .Content.InsertParagraphAfter
    With Worksheets("Sheet1")
        Cells(1, 1).Select
        Cells(1, 1).Copy
    End With
    .Content.InsertAfter "AddTableHere"
    .Content.Find.Execute FindText:="AddTableHere", ReplaceWith:="^c"


End With

Has anyone any suggestions on how I could do this?

Thanks

A: 

The Selection object in Word has a PasteExcelTable method which might fit the bill - see MSDN for details

barrowc
Have tried that aswell, but pasting in to a document seems to overwrite all the contents of the document, even when i select to move the cursor to the end or the start. This macro will loop a number of times on the one document, so pasting doesnt seem to be an option for me