Text fonts in Visio 2003 problem

E

Erik Wel

Hi,

I am working on a VBA Visio 2003 application.
From data out of a database a make a drawing based on that data.
I am trying to set the Font of all text objects to 'Franklin Gothic
Book'
To get the right code for setting this font I made a macro where a
changed the font of an object.

The code told me that setting the font to Franklin Gothic was this:
vsoShape.CellsSRC(visSectionCharacter, 0, visCharacterFont).FormulaU =
"41"

so I used this code to set the font of all my shapes.
Now here is the problem
It works fine on my machine (W2K) but not on an other machine (WXP)
the "41" code is franklin gothic on my machine but on the XP machine
it was somthing else.

I want to make it platform independent off course but how do I do
that?
How do I determine what the font code is for Franklin Gothic on any
machine?

Please Help.

Greetz,

Erik
 
M

Mark Nelson [MS]

The Visio document has a Fonts collection that you can look up fonts in.
The following code will return the proper value for a font. Make sure you
put in the exact font name.

ActiveDocument.Fonts("Franklin Gothic Book").Index
 
E

Erik Wel

Mark,

This works indeed.
Great, thanx.

Erik

ps: because i could not find my posting I posted this question again today.
now that i found it you can ignore that one, sorry
 

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