Changing included vba code programmatically

L

les

We have a large number of visio documents (thousands) which were created
using a template. Automation within the documents is provided via a stencil
which loads when the document is opened with automation activated. The
template contains the information as to which stencil to load.

All of the documents contain VBA code (created by the template) which
provides the functions to load the stencil.

We wish to change the name and location of the stencil to be loaded by these
documents. Other than going into each document and changing the code, is
there any way that we could write, say a visual basic program, to open each
visio document and change the VBA code?
 
A

Al Edlund

You might consider investigating something like saving the documents as xml
and then editing them before restoring them as vsd. It turns out that the
VBA is stored in a section called VBProjectData as base64(MIME) and might be
editable from there. (open vsd, save as xml, edit xml, save xml, open xml
document, save as vsd-repeat as necessary). I was able to open the
VBProjectData in an active document but am still looking for a decent mime
decode/edit process in VB.
al
 
L

les

Al Edlund said:
You might consider investigating something like saving the documents as xml
and then editing them before restoring them as vsd. It turns out that the
VBA is stored in a section called VBProjectData as base64(MIME) and might be
editable from there. (open vsd, save as xml, edit xml, save xml, open xml
document, save as vsd-repeat as necessary). I was able to open the
VBProjectData in an active document but am still looking for a decent mime
decode/edit process in VB.
al
 
L

les

Al Edlund said:
You might consider investigating something like saving the documents as xml
and then editing them before restoring them as vsd. It turns out that the
VBA is stored in a section called VBProjectData as base64(MIME) and might be
editable from there. (open vsd, save as xml, edit xml, save xml, open xml
document, save as vsd-repeat as necessary). I was able to open the
VBProjectData in an active document but am still looking for a decent mime
decode/edit process in VB.
al
Thanks for your comments and interest. I will play around with the concept.
One thought I had was to write a VB program to open the visio documents and
then use the old 'steam powered' sendkeys to access and change the code.
Whatever, it seems I am not going to get a clean solution.
 

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