Finally I reluctantly upgraded to CorelDraw Version 24.5.0.731 - September 2023 Release.I'm running into an issue with VBA. I created a pricing macro that creates artistic text with specific brand fonts and colors. When I open older files from a month ago, I get a missing font error. Same font name, but there's additional version information Corel wants to match. I didn't have this issue in Corel 2020.
I made a simple text macro that creates text with the brand fonts. Getting an error on 5 of the 8 fonts. Not sure what is happening here. Do I have to write the full name "GoodOT-CondBold-Bold (OpenType - PostScript) (Version 7.504; 2010; Build 1002) (Western)" in the code?
Sub CreateTextTest() Dim Font As Shape Set Font = ActiveLayer.CreateArtisticText(0.5, 1, "Gotham Bold", , , "Gotham Bold", 30) 'Prints! Font.Fill.UniformColor.CMYKAssign 100, 0, 100, 0 DoEvents Set Font = ActiveLayer.CreateArtisticText(0.5, 2, "TitlingGothicFB Comp Medium", , , "TitlingGothicFB Comp Medium", 30) 'Blank DoEvents Set Font = ActiveLayer.CreateArtisticText(0.5, 3, "Bud Bold", , , "Bud Bold", 30) 'Blank DoEvents Set Font = ActiveLayer.CreateArtisticText(0.5, 4, "Trade Gothic LT Std Bold", , , "Trade Gothic LT Std Bold", 30) 'Blank DoEvents Set Font = ActiveLayer.CreateArtisticText(0.5, 5, "TradeGothicNo.20-Condensed", , , "TradeGothicNo.20-Condensed", 30) 'Blank DoEvents Set Font = ActiveLayer.CreateArtisticText(0.5, 6, "Futura Md BT", , , "Futura Md BT", 30) 'Prints! Font.Fill.UniformColor.CMYKAssign 100, 0, 100, 0 DoEvents Set Font = ActiveLayer.CreateArtisticText(0.5, 7, "Suti", , , "Suti", 30) 'Prints! Font.Fill.UniformColor.CMYKAssign 100, 0, 100, 0 DoEvents Set Font = ActiveLayer.CreateArtisticText(0.5, 8, "GoodOT-CondBold", , , "GoodOT-CondBold", 30) 'Blank DoEvents Set Font = Nothing End Sub
Maybe you could try to see if you can just type in text using the font you want to use.
If you can, then a simple macro to return the font name to check how Corel is returning the name.
You can then use that exact font name in your code.
I would additionally suggest not to use variable names that could possibly be a keyword, e.g., use a variable name like 'mFont' instead of 'Font'