SaveAsPicture differences between Publisher2003 and Publisher2007

M

MarcoNegri

Good morning.
I am converting an application, previously written in VB6/Publisher2003, in
C#/Publisher2007.
The original app open Publisher, merge fields from db and save it as a
picture, filled with the correct values.
Now, I have to use Publisher2007 and C#;
the task was not very difficult (because Publisher2007 must be programmed
using COM object, and I simply translate every instruction from VB to C#).
All run fine, until the call to Page.SaveAsPicture...
With Publisher2007, the picture saved does not contains the merge value, but
the name of fields ( <<field_name>> ).
Well, the app open Publisher, merge the fields ( and I can see the correct
values )
but, debugging the app I see a very strange thing:

previous code row -> see field values
Page.SaveAsPicture -> see field names
next code row -> see field values

Seems like something change in the method, from 2003 to 2007...

Could someone help me, please?
Thanks in advance

Marco
 
F

Fred

Could someone help me, please?

Apparently not. You may also come across an issue whereby page.saveaspicture
sporadically seems to get the page size completely incorrect.
Sadly, one of the many things Microsoft isn't very good at and seem to have
no interest in is fixing bugs or making genuinely useful improvements in
Publisher.
Best advice would be to use a proper dtp program like Adobe Indesign, which
is fully scriptable and mostly works properly.
 
M

MarcoNegri

Thanks for replay, i have solved.
For the community, i worked around this issue using
MailMerge.Execute method, that return a Document;
then, on this object, you can call the SaveAsPicture
that is correctly executed.
Thank to Ms for documenting this change...
 

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