Skip to main content
June 12, 2009
Question

text style : set bold + italic

  • June 12, 2009
  • 1 reply
  • 1063 views

hi

how can i set a selected test to "bold + italic"

Dim TextFrameTool As InDesign.TextFrame = Page.TextFrames.Add

i try like this but fail

TextFrameTool .ParentStory.FontStyle = "Bold" & vbCr & "Italic"

and to set text color

e.g

TextFrameTool .ParentStory.FillColor = app.ActiveDocument.Swatches.Item("C=15 M=100 Y=100 K=0");

for the color one, it return me error and i not sure about this code is correct or not

can someone help me in this ?

thanks

This topic has been closed for replies.

1 reply

Jongware
Community Expert
Community Expert
June 12, 2009

VB might differ in syntax details, but I think you are building the string the wrong way:

"Bold" & vbCr & "Italic"

In JavaScript, "Bold Italic" works. Note that your current font must have this style in its repertoire, or else you get the pink background.

June 13, 2009

hi,

but how can i set the font color ?

thanks

Peter Kahrel
Community Expert
Community Expert
June 14, 2009

In your code there's a space after TextFrameTool, maybe that's the problem.

Peter