How do I use DSO custom properties in Visio drawing?

P

pnp

Hi

We have a document management system utilizing DSOFile.dll to write custom
properties on Office documents. This means that the document can contain meta
information about several things. In other Office applications it is possible
to insert these properties as fields in a document.
I can, however, not seem to figure how and if this is possible in Visio? Can
anybody please help here?
We have full control over the Document Management system, so it is possible
for us to add the properties to a Visio drawing in a different way, if this
can get the task done.

So simply - does anybody know how it is possible to store extra information
about a Visio drawing, and be able to use this information as a field inside
the drawing? Using Office 2003 by the way.

Regards
/Anders
 
D

David Parker

I don't think you can add document custom properties in the same way as you
can with other Office apps.
Visio documents can have document level SolutionXML, but your users would
need to save the documents in XML format for you to be able to access them
without using Visio.
 
P

pnp

Hi David...

I was afraid that would be the answer... I don't think i can rely on my
users saving the document as XML... Of course we could make the available
Visio templates only available as XML documents. But since too many people
have access to modify templates, this will probably not be that easy to get.

Do you know if this is possible in Office 2007? I haven't worked that much
with that yet, but as i understand all 2k7 documents are saved as xml
documents, which should make it easier to make custom additions?

Anyways - i will postpone this issue a bit, since we don't have the time to
investigate what consequences changing all Visio documents to XML document
will have.

But thanks for your reply, it saves me some time going through options and
help files for Visio to prove what i I thought... :)

Best regards
/Anders
 
D

David Parker

...hold on a minute .. I can sense an update coming from John (he's been busy
testing dsofile)...
 
J

John

Where do you get that sixth sense from?

Well yes, I noticed that this article http://support.microsoft.com/kb/224351
has been updated in the last few days so I tested the VB.NET sample that
comes with the download and can confirm that you can add custom properties
to Visio 2007 docs using this dll.

David's right of course that there's no access to custom properties through
the application UI or via straight code (VBA for example).

I haven't tried this on a Visio 2003 document, but my assuption is that this
would work in the same way as both have manual access to custom properties
when you right-click the file in Windows Explorer.

Anyway, hope that helps.

Best regards

John
 
P

pnp

Well, the problem was not as much as using DSOFile to set and read the custom
properties, we have done this for a office 2003 for some time.

The issue was to be able to display the properties on a visio drawing, so
that a print of this will contain information on where to find the digital
copy of the drawing...

/Anders
 
J

John

Hello Anders,

Sorry, I misunderstood your original post. If you're just looking for a way
to display the path then you could drop a text shape onto a background page
and insert a field showing the information:

Insert/Field/Document Info/Directory and Insert/Field/Document
Info/Filename

This of course applies to the other standard document properties as well.

For the custom file properties one method might be to set your properties
using the DSOFile.dll as you've been doing and then open the respective
document and add these again to a user cell/s in the document's shapesheet.
The resulting user cell contents could then be inserted in a text field in
the above manner.

Another option might be to "miss use" the Decription field, for example, and
add values to it using your own delimiter (eg "My 1st Value%My 2nd Value%My
3rd Value"). This could again be accessed using the inserted field method,
where you could use:

Insert/Field/Custom Formula/

and the formula:

=INDEX(1,DESCRIPTION(),"%","")

which in the above case would return "My 2nd Value" (Note - the Index
function uses a zero based index).

A caveat to this is that I'm not sure what the Description field's max
string length is, but I guess you could experiment to see if it works for
your needs.

The benefit of using a User cell is that Visio's text based cells can take
unlimited length strings so you won't have the above restriction.

Anyway, hopefully I've got the right end of the stick now!

Hope that helps.

Best regards

John
 

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