Insert Chart into Word

M

Maynard

I'm not sure if this should be posted here or in the Word NG, but...

I'm trying to write a macro that will copy a selected chart (in Excel) into
an open Word Document (at the current location of the cursor). Unfotunately,
I'm only familiar with the Excel object model, not the Word object model. I
have the following code (but cant figure out what to put in XXXX). Of
course, I may be going about this completely the wrong way. Thanks for any
help...

Sub PortToWord()

Dim WrdDoc As Word.Document

Set WrdDoc = Word.ActiveDocument
ActiveChart.Copy
WrdDoc.XXXX.PasteSpecial DataType:=wdPasteEnhancedMetafile,
DisplayAsIcon:=False


End Sub
 
F

Fredrik Wahlgren

Maynard said:
I'm not sure if this should be posted here or in the Word NG, but...

I'm trying to write a macro that will copy a selected chart (in Excel) into
an open Word Document (at the current location of the cursor). Unfotunately,
I'm only familiar with the Excel object model, not the Word object model. I
have the following code (but cant figure out what to put in XXXX). Of
course, I may be going about this completely the wrong way. Thanks for any
help...

Sub PortToWord()

Dim WrdDoc As Word.Document

Set WrdDoc = Word.ActiveDocument
ActiveChart.Copy
WrdDoc.XXXX.PasteSpecial DataType:=wdPasteEnhancedMetafile,
DisplayAsIcon:=False


End Sub

Wouldn't it be better to paste the chart as an image file?

/Fredrik
 
M

Maynard

Right now I'm just worried about pasting the chart into my document, not what
format is better.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top