Change to specific Font programmaticly in Visio 2003

E

Erik Wel

Hi,

I am trying to change the font of my text-shapes programmaticly.
I do this now by adding this code:
vsoApp.ActiveWindow.Page.Shapes.ItemFromID(iShapeID).CellsSRC(visSectionCharacter,
0, visCharacterFont).FormulaU = "41"

Now on my W2K machine this is Franklin Gothic Book but on another
machine it's a different font!
logicaly I would like to make it platform independant so that if i run
this codeline on another machine the font also turns into Franklin
Gotic book. (or anything else)
probably 41 is linked to Franklin gothic book on my machine but if
someone has more or less fonts on his machine, it is a different
numer.

So what I would like to do is somthing like this:
vsoApp.ActiveWindow.Page.Shapes.ItemFromID(iShapeID).CellsSRC(visSectionCharacter,
0, visCharacterFont).FormulaU = "Franklin Gothic book"

but this line does not work.

Help would be appriciated very much!

Greetz,

Erik
 
K

Kari Yli-Kuha

Erik Wel said:
Hi,

I am trying to change the font of my text-shapes programmaticly.
I do this now by adding this code:
vsoApp.ActiveWindow.Page.Shapes.ItemFromID(iShapeID).CellsSRC(visSectionCharacter,
0, visCharacterFont).FormulaU = "41"

Now on my W2K machine this is Franklin Gothic Book but on another
machine it's a different font!
logicaly I would like to make it platform independant so that if i run
this codeline on another machine the font also turns into Franklin
Gotic book. (or anything else)
probably 41 is linked to Franklin gothic book on my machine but if
someone has more or less fonts on his machine, it is a different
numer.

So what I would like to do is somthing like this:
vsoApp.ActiveWindow.Page.Shapes.ItemFromID(iShapeID).CellsSRC(visSectionCharacter,
0, visCharacterFont).FormulaU = "Franklin Gothic book"

We've done it thusly:

' Find unicode font
For Each ovFont In ovDoc.Fonts
If ovFont.Name = "Arial Unicode MS" Then
Exit For
End If
Next ovFont

If ovFont.Name <> "Arial Unicode MS" Then
MsgBox ovDoc.Name & " contains NO Unicode fonts", vbInformation
Exit Sub
End If

[...]
ovShape.CellsSRC(visSectionCharacter, iRow, visCharacterFont).FormulaForceU = CStr(ovFont.ID)

/C
 

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