2 Replies Latest reply: Feb 27, 2012 10:41 PM by Daves61 RSS

    How to set grid alignment as "First line Only" for any paragraph style

    Daves61

      Hi..Please help me out.

      I have to set grid alignment as "First line only" for any paragraph style.

      I am using the code below to set grid alignment as"All lines".

      *********************************************************************************

                  InterfacePtr<ITextAttributes> textAttributes(styleInfo, UseDefaultIID());

                  InterfacePtr<ITextAttrGridAlignment> attrGridAlignment(::CreateObject2<ITextAttrGridAlignment>(kTextAttrGridAlignmentBoss));

                  attrGridAlignment->SetGridAlignment(Text::kGABaseline);

                  textAttributes->ApplyAttribute(attrGridAlignment);

       

      Here, I created text attribute of grid alignment and applied it to styleInfo of the style.

      Now, the problem is that I have tried all the available values of Text::GridAlignmentMetric but none of them sets it to "First line only". Please tell me the solution of this problem. I am running out of time.

      Thanks in advance.