Question
Getting the ITextModel of selected textframe
Hi list,
tought this was an easy one but i spend the whole afternoon getting this to work and still nothing.
I have a routine that performs some action on the ITextModel of selected text.
The same routine should also work with all the text of the currently selected frame, but i don't succeed in getting access to the ITextModel.
Here's my code (without asserts for reading purposes), but the InterfacePointer to ILayoutTarget always returns nil. Can anyone help me out?
Florian.
IActiveContext *myContext = gSession->GetActiveContext();
InterfacePtr<ILayoutTarget> layoutTarget(myContext), UseDefaultIID());
UIDList itemList = layoutTarget->GetUIDList(kStripStandoffs);
UIDRef graphicFrameUIDRef = itemList.GetRef(0);
tought this was an easy one but i spend the whole afternoon getting this to work and still nothing.
I have a routine that performs some action on the ITextModel of selected text.
The same routine should also work with all the text of the currently selected frame, but i don't succeed in getting access to the ITextModel.
Here's my code (without asserts for reading purposes), but the InterfacePointer to ILayoutTarget always returns nil. Can anyone help me out?
Florian.
IActiveContext *myContext = gSession->GetActiveContext();
InterfacePtr<ILayoutTarget> layoutTarget(myContext), UseDefaultIID());
UIDList itemList = layoutTarget->GetUIDList(kStripStandoffs);
UIDRef graphicFrameUIDRef = itemList.GetRef(0);