tags:

views:

74

answers:

1

is there any simple way to replace an image inside word-document with an excel chart using VB and preserving all of the format details such as image frame style, text wrap, anchor, etc. (thus the image is just a placeholder in a template document)

A: 

if i'm right - there is no decent way to replace an image. so i've replaced autoshape background

Charts(chart_name).Export path + "chart.gif", "GIF" word_app.ActiveDocument.Shapes(autoshape_name).Fill.UserPicture path + "chart.gif"

...still, there is no way to set "autoshape_name" from MS Word UI. so i must write additional macros for it. that's annoying

If you're using Word 2007, you can set the autoshape name via the UI. It's on the Home Ribbon tab -> Editing - Select -> Selection Pane.
Otaku