Visio Guy

Visio Discussions => Visio 2010 Issues => Topic started by: john.monroe on April 30, 2013, 08:09:03 PM

Title: Use my own template and Stencil
Post by: john.monroe on April 30, 2013, 08:09:03 PM
I am uisng your VBA Code to modify a Visio Diagram.  I want to use my own template.
Const FlowchartTemplateName$ = "c:\temp\visio\OCUdefaultFTDRTemplate.vst"
Const FlowchartStencilName$ = "BASFLO_M.VSS"

But I am getting an error unexpected end of file.

Can you advise on the code changes needed to use my own template and stencil?

Thanks for your help in advance.
Title: Re: Use my own template and Stencil
Post by: Paul Herber on April 30, 2013, 10:57:33 PM
Which code are you modifying?
Title: Re: Use my own template and Stencil
Post by: john.monroe on May 02, 2013, 05:14:10 PM
I figured this out to a smaller degree.  Basically if you are using a custom stencil there is some additional code needed to make it all work with the existing code.
Here is the example. http://www.visguy.com/2006/09/13/create-visio-flowcharts-programmatically/
if you change the stencil and template to pull from a local souce like c:\temp it fails to open the master process section.
  Set mstProcess = _
      docFlowStencil.Masters.ItemU(MasterProcessName)

When I commented out the code I could run it with some additional parameters.  So basically the example did nto work for me out of the site but after making some changes I got it working.