Shapes.AddPicture in MailMerge causes Word crash

G

genem

I am developing a VBA script to add barcode picture. Barcode value
comes from DataSource during MailMerge.
To do this Shape is added in MailMergeBeforeRecordMerge even handler.
For
example:
Set oShape = Doc.Shapes.AddPicture(filename, false, true, 100, 100)

Examining oShape object in Watch produces "Automation Error" for
number of properties (e.g Left) Access to these properties (even after
just using Watch) causes crash of Word.

- Problem is not related to barcode. Adding any picture fails.
- Can add InlineShape. But after ConvertToShape, the same problem.
- Can add Shape in event handler to some other document. But not to
merged document.
- Same problem in MailMergeAfterRecordMerge

Any advise is highly appreciated.
Thans
Gene
 

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