Printing Excel Data into a MSWord document as formatted text, not a table.

nbonanno

New Member
Joined
Jul 23, 2013
Messages
16
My boss is being difficult. Using some code I found on this site, I can have our status report Excel spreadsheet create a lovely MSWord document...but the data is in table format. She wants plain ole' formatted text. When I use " appWD.Selection.Pastespecial datatype:=wdpastetext" it comes over without bolds or underlines. I also tried wdpasteRTF but that seemed to give me a table again.

Is there someway to have it copied into the MSWord document "prettily" but not be in a table? Thank you in advance.

Here is my code:

<code>Sub Create_msword_for_Kia_Report()
Dim appWD As Word.Application
Set appWD = CreateObject("Word.Application.12")
appWD.Visible = True
appWD.Documents.Add

Sheets("For Kia's Report").Select
Range("a1:g9").Copy
appWD.Selection.PasteSpecial DataType:=wdPasteText
appWD.ActiveDocument.SaveAs
Filename:="C:\Users\nb7149\Documents\Issuetrak\statusreport.doc"
appWD.ActiveDocument.Close
appWD.Quit
End Sub

</code>
 
Wonderful - I will give this a try as soon as I have a moment and I'll let you know. Thanks again for your help.

Don't know. I can't replay the macro because I get an error when assigning the appWD .

But if I do it manually, all the formatting is kept.

You could also put the last parameter in
Code:
    appWD.Selection.PasteExcelTable False, False, False

to True
Code:
    appWD.Selection.PasteExcelTable False, False, True

which pastes it as RTF, see if that helps
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,223,237
Messages
6,170,928
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top