Hey guys, I was wondering if anyone has a code snippet for exporting an active shape as a PNG with transparency. For whatever reason X5 doesn't seem to record half of the things you tell it to. I've tried using the same method I use for exporting a JPEG by using cdrPNG instead of cdrJPEG but it doesn't work.
So does anyone know the code to use for exporting a PNG?
And does anyone know why X5 doesn't record hardly anything when telling it to record a macro?
Thanks.
Andru Bruning said:And does anyone know why X5 doesn't record hardly anything when telling it to record a macro?
Hi.
My recorder hasn't worked in...... I guess since X5.
The recorder is the best way to get the export settings for a file type. Do you have a version of X4? The recorded code should be the same for this.
-John
RunFlaCruiser said:Do you have a version of X4? The recorded code should be the same for this.
I do not have a version of X4. I only have X5 currently.
Here's some code I dug up regarding a PNG export. After the WITH statement you can press enter and the a period (.) on the keyboard to access more options, if any.
Set expflt = ActiveDocument.ExportBitmap("D:\" & c & ".png", cdrPNG, cdrSelection, cdrRGBColorImage, 0, 0, 300, 300, cdrNormalAntiAliasing, False, True, True, False, cdrCompressionNone) With expflt .Interlaced = True .Transparency = 0 .invertmask = False .Color = 0 .Finish End With
PS. Change path and filename too.
This looks like what I attempted using code I had from exporting JPEGs but it didn't work for me either. I'll have to see if this will work. Maybe some of the options I had were JPEG specific. I'll let you know if this works.
RunFlaCruiser said:Here's some code I dug up regarding a PNG export.
Sweet. That worked. I must have just been adding options that were used for JPEGs and not PNGs.
Thanks for your help.
Andru Bruning said:Sweet. That worked. I must have just been adding options that were used for JPEGs and not PNGs.
Cool.
Now if I can just get my recorder working. I'll prolly re-install someday. Recording is the best way for exporting because it's pretty much impossible to remember all options with every format.