code for save as gif problems

J

JustNatalie

I cannot get the resolution using code for gif that I can get when I use the
menu options: file, save as, .gif Then image attributes and resolution are
saved in the gif file just as they appear in publisher. Perfect! I am using
the images in Dreamweaver, and they work well with the program (I am saving
imported html images originated in Excel).

However, when I write code (I am not particularly advanced; I know), my
resulting gif does not have the clarity as when I save through the menu
options method. No matter what the dpi I choose, it looks bad simply when
opened in a web browser or used by another program, Dreamweaver in this case.

My code is below. If anyone can help, I would appreciate it.

Thanks, in advance everyone, Natalie:

Public Sub SaveAsPicture_Example()

Dim pubShapeRange As Publisher.ShapeRange
Set pubShapeRange = ThisDocument.Pages(1).Shapes.Range
pubShapeRange.SaveAsPicture "s:\cab\img\zzgifpub.gif",
pbPictureResolutionWeb_96dpi

End Sub
 
E

Ed Bennett

JustNatalie said:
I cannot get the resolution using code for gif that I can get when I use the
menu options: file, save as, .gif Then image attributes and resolution are
saved in the gif file just as they appear in publisher. Perfect! I am using
the images in Dreamweaver, and they work well with the program (I am saving
imported html images originated in Excel).

What version of Publisher are you using?
 
E

Ed Bennett

I am using Office Publisher 2007.

I just tested this and got identical images when exporting at 300dpi
using the Save As Picture right-click menu item, the File > Save As, and
the code version, and all give indistinguishable output.

I'm not sure why you're looking to output at high resolution if the
content is going to be dropped into DreamWeaver - Web Resolution (the
default) is such that if you drop the image in, then it will appear the
same as at 100% zoom in Publisher.

I notice that in the code snippet you posted you used:

pubShapeRange.SaveAsPicture "s:\cab\img\zzgifpub.gif",
pbPictureResolutionWeb_96dpi

pbPictureResolutionWeb_96dpi is the same as selecting "Web Resolution
(96dpi)" in the Save As screen; the equivalent of the higher-resolution
option would be pbPictureResolutionCommercialPrint_300dpi.
 
J

JustNatalie via OfficeKB.com

Ed:

Thanks for taking a look at my problem. It works for you; there is hope. A
question:

I suspect that it might be how I am importing the file from Excel. The
worksheet that I made includes more than one chart and several text boxes. I
also designed it as a full page layout for 8.5†x 11†paper. What method did
you use to import the Excel worksheet into Publisher?

Thanks again, Natalie
 

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