Hi,
I am trying to underline the particular text from selected Note by using the following code
//======================================================//
CComPtr
m_pSwApp->get_IActiveDoc2(&pSWModel);
CComPtr
pSWModel->get_ISelectionManager(&pSWSelectionMgr);
CComPtr
pSWSelectionMgr->GetSelectedObject6(1, -1, &pSelectedEntity);
CComQIPtr
CComBSTR text;
pNote->GetText(&text);
long txtCount;
pNote->GetTextCount(&txtCount);
CComPtr
pNote->IGetAnnotation(&pAnnotation);
long txtFormatCount;
pAnnotation->GetTextFormatCount(&txtFormatCount);
CComPtr
pAnnotation->IGetTextFormat(0, &txtFormat);
txtFormat->put_Underline(VARIANT_TRUE);
VARIANT_BOOL retVal;
pAnnotation->ISetTextFormat(0, FALSE, txtFormat, &retVal);
//======================================================//
Here, my txtCount is 5 and txtFormatCount is 1. If I use the pAnnotation->ISetTextFormat() method then it underlined all text but I want to underline the first line text only.
I have tried changing the index (i.e. 0 in the above code) but it underlined all the text for each index. Is anyone know How should I underlined that particular text?
Thanks and Regards,
Mahadev
SolidworksApi/macros