Export PDF out of Visio using VBS

Started by chessat2002, January 07, 2012, 08:44:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

chessat2002

Hi VBS-Guys,

shortly summarized, I would like to do the following (simple) stuff:

x Start Visio
x Open a drawing
x Save this drawing as PDF
x Close Visio

I'm using Windows 7 with a Office/Viso 2010 installation (SP1).
Right now, I have the following code:

set app_visio = CreateObject("Visio.Application")
app_visio.Visible = True
app_visio.Documents.Open "<PATH>"
app_visio.ActiveDocument.ExportAsFixedFormat visFixedFormatPDF, "<PDF-PATH>", visDocExIntentPrint, visPrintAll, 1, 2, False, True, False, False, False


(just replace the paths)

Problem: At the last line (when attempting to save the drawing as PDF), I always get the following error:

Acces has been denied.
Code: 86DB0971


Maybe someone has an idea what's going wrong here or someone else is able to run this script without error on his machine.

Thanks a lot for your support,

Alex'

vojo

cannot natively export visio to a PDF

I use a PDF print driver to do this   PDF995 is real good for this

Print Visio
Select PDFprint driver from printers list
voila

chessat2002

Visio can do this (I think it's a plugin that is installed by default). See my attachment.
Your idea with the PDF-printer would be my plan B ...
Alex'

Paul Herber

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

vojo


chessat2002

Yes, this is a really nice feature of Visio 2010. Even though I didn't figure out the problem until now (hours and hours of google research).
Isn't there anybody who can automate this step and who is successful with it?

Thanks a lot, Alex'

Paul Herber

You might have to be patient until people get back to work on Monday.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Browser ID: smf (is_webkit)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 243 (show)
Files included: 34 - 1317KB. (show)
Memory used: 1107KB.
Tokens: post-login.
Cache hits: 12: 0.00210s for 26,582 bytes (show)
Cache misses: 1: (show)
Queries used: 15.

[Show Queries]