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.
Are you applying that attribute via kEditTextStyleCmdBoss or equivalent? If not, consider to do that.
kGABaseline is what you need. In addition (see style edit dialog for an hint) you'll need kTAGridAlignOnlyFirstLineReportBoss - set the IID_ITEXTATTRBOOLEAN to true ...
Dirk
Thanks a lot Dirk..It worked fine
I was looking for "kTAGridAlignOnlyFirstLineReportBoss" only...