Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have few buttons and I want to set its font style(bold/italic) in macro. can anybody tell me how do I do this??
Thanks in advance!!!
Hi,
Try this Macro
SUB Font()
set obj = ActiveDocument.GetSheetObject("BU01")
set fnt = obj.GetFrameDef.Font
fnt.PointSize1000 = fnt.PointSize1000 + 1000
fnt.FontName = "Calibri"
fnt.Bold = true
fnt.Italic = true
fnt.Underline = true
obj.SetFont fnt
END SUB
Regards,
jagan.
Hi,
Try this Macro
SUB Font()
set obj = ActiveDocument.GetSheetObject("BU01")
set fnt = obj.GetFrameDef.Font
fnt.PointSize1000 = fnt.PointSize1000 + 1000
fnt.FontName = "Calibri"
fnt.Bold = true
fnt.Italic = true
fnt.Underline = true
obj.SetFont fnt
END SUB
Regards,
jagan.
Hi Jagan,
Thanks a lot for the reply
Is there a way to set all buttons font style using single line statement??
Hi,
Try like this
SUB Font()
set obj = ActiveDocument.GetSheetObject("BU01")
set fnt = obj.GetFrameDef.Font
fnt.PointSize1000 = fnt.PointSize1000 + 1000
fnt.FontName = "Calibri"
fnt.Bold = true
fnt.Italic = true
fnt.Underline = true
obj.SetFont fnt
set obj = ActiveDocument.GetSheetObject("BU02")
obj.SetFont fnt
set obj = ActiveDocument.GetSheetObject("BU03")
obj.SetFont fnt
set obj = ActiveDocument.GetSheetObject("BU04")
obj.SetFont fnt
END SUB
Regards,
Jagan.
Hi Jagan,
I got what you are trying to say, tried, and its working also. Thanks a lot for that
But I just wanted to know whether there is any way using which we can set all buttons font style instead of doing individually as below
set obj = ActiveDocument.GetSheetObject("BU04").
Hi,
I think No, you have to manually assign for each and every object. Try using for or while loops if their pattern of IDs are same like BU01, BU02, BU03 etc.
Regards,
Jagan.
Okay.. Thanku