Can't set FontSize in script

I am using the following line in my code

DesktopX.Object("Digital").FontSize = 10

and I get the following error message

Wrong number of arguments or invalid property assignment: 'FontSize'

What am I doing wrong?

Thanks
556 views 5 replies
Reply #1 Top
ill look in a second.. but i think it has to have the '10' not 10 or "10"

 

im checking now.
Reply #2 Top
Ok im stuck too.

 

Is it possible that the font things are READ only?

 

If i do

 test = object.fontsize

 object.text = test

 

 it shows 9 for the text

 But i tried EVERY combination for trying to SET the fontsize.

 

BUTTTT

 

 this does seem to work:

  Object.SetFont fontName, size, boolBold, boolItalic, boolUnderline, boolStrikeOut, lfCharSet
You can leave the last parameter = 0

 

 This is what i tried:

  Object.SetFont Tahoma, 50, True, False, False, False, 0

 

It worked just fine.

Not sure if there is a bug in the size/font stuff.

 
Reply #3 Top
Thank you Roman,

The Object.SetFont worked fine. My assumption is the Object.FontSize is a bug.
Reply #4 Top
RomanDA, that is great! Nice job figuring that out. I can't get the underline or strikethrough to show, though.

I noticed if you put font name in quotes you can use font names that include spaces, like "Arial Black" and "Trebuchet MS" -- which, as far as I can tell, you can't do with Object.FontName. So you've solved several issues with this info!
Reply #5 Top
Also, in order to set one value, you must set them all using the SetFont attribute. Meaning your example, Romanda, will work fine, as long as you include all the attributes every time.


Object.SetFont Tahoma, 50, True, False, False, False, 0