VSD file Custom Document Properties

B

ben h

Hi, I've searched the groups a bit and not found an answer. Can someone
explain to me how I would declare/ use the Win32 API to access a file's
document properties from inside the VBA environment?

To be really clear, I want to access the Custom Properties of the Visio
file, normally accessible from windows explorer via File > Properties >
Custom, and NOT the Custom Properties of the Visio DocumentSheet or
Visio PageSheet objects.

I think that the generic document properties are available like Creator,
etc, but I need to set & read some extended/ builtin/ custom properties.

Cheers,
Ben
 
J

JuneTheSecond

If you can save the file as an xml file with the menu of the Visio, then you
might be able to get custom properties with IE or note pad.
 
A

Andy

Have you checked out this, http://support.microsoft.com/?id=224351

You can dowload a dll that you can add as a reference to your VBA
project and then access various fields as per explorer etc.

e.g

dim myDSO as DSOFile.OleDocumentProperties


set myDSO = new DSOFile.OleDocumentProperties

call myDSOOpen("filename",True)

debug.print myDSO.SummaryProperties.Title

call myDSO.Close

I've used it to get at the document properties, but I belive you can
get at others as well.

Andy
 
B

ben h

JuneTheSecond said:
If you can save the file as an xml file with the menu of the Visio, then you
might be able to get custom properties with IE or note pad.

Thanks for the suggestion, but seems a bit extravagant. I need to access
the document properties of the currently open file.
Ben
 
A

Andy

Yes, you need to distribute the dll. In my case I included the dll as
part of my application which already has a setup script that is run to
install my application. As part of this it registers the dll,

regsvr32 "yourPath\dsofile.dll" /s
 
D

David Parker

The normal documnet ptoperties (Title, Subject, Creator, Company, Manager,
Description, Keywords ) are available as properties of the document object.
I don't think that Visio supports custom document properties like Word &
Excel
..
 
J

JuneTheSecond

You might add user defined section to the shapesheet of the document, and add
data. Then you could read as if it were extended document properties by the
code such as;
Dim DSheet As Visio.Shape
Dim I As Long, cnt As Long
Set DSheet = ActiveDocument.DocumentSheet
cnt = DSheet.Section(visSectionUser).Count
For I = 0 To cnt - 1
Debug.Print DSheet.CellsSRC(visSectionUser, I, 1).Formula,
DSheet.CellsSRC(visSectionUser, I, 0).Formula
Next
 

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