Is there a reliable way of setting font family in Visio VBA ?
I have 1 macro-enabled file ( .vsdm) with one stencil file containing macros (.vssm), and hundreds of .vsd and .vsdx files containing diagrams.
I use the macros to open the .vsdx files and make changes such as changing the font.
To change a font, from what I read, you can't just say this shape should have the font named 'arial'. You have to get the ID of the font (an integer) and apply that font, using a formula such as shp.CellsSRC(visSectionCharacter, 0, visCharacterFont).FormulaU = "238"
To get the id, I use a formula like font_ID = ActiveDocument.fonts.Item(fontName).ID
BUT the font IDs in the macro file appear not to be the same as in the .vsdx and .vsd files I open with the macro.
Therefore I GET A RANDOM FONT using this method.
How can I safely set the font family of a shape?