Copy link to clipboard
Copied
Using C++ how can I get the text that is inside an anchored text frame.
I do have the UIDRef of the ancher text frame, but I am not able to get the text inside it.
appreciate the help,
Joe
Oops :
InterfacePtr<IHierarchy> iInlineHierarchy(_UIDRef_you_have_, IID_IHIERARCHY);
// The first child is the kSplineItemBoss of the nested text frame
InterfacePtr<IHierarchy> iSplineHierarchy(iInlineHierarchy->QueryChild(0));
// kMultiColumnItemBoss
InterfacePtr<IHierarchy> iMultiColumnItemHierarchy(iSplineHierarchy->QueryChild(0));
// kFrameItemBoss
InterfacePtr<IHierarchy> iFrameItemHierarchy(iMultiColumnItemHierarchy->QueryChild(0));
// I forgot this
InterfacePtr<ITextFrameColumn> iTextFram
...
Copy link to clipboard
Copied
Please explain more about how you are wanting to access this ? C++ programming language ?
What are you trying to achieve with this ?
Copy link to clipboard
Copied
I am creating an InDesign PlugIn.
I am looping to get the text inside the anchored text boxes. I am able to get the text inside the parent text frame and identify the anchor text frame itself. However, I am not able to get the text inside the child(anchored) frame.
Appreciate the help.
Joe
Copy link to clipboard
Copied
Hi,
This might help - https://community.adobe.com/t5/indesign/how-do-i-get-a-list-of-inline-anchored-objects-in-a-text-fra...
Malcolm
Copy link to clipboard
Copied
Thank you for your suggestion. I am able to get the list of the inline items in a frame. The issue remains, that I am not able to get the text that is inside the inline item.
Appreciate the help,
Joe
Copy link to clipboard
Copied
If you have the UIDRef of the inline item then you have to use hierarchy to get the nested text frame :
InterfacePtr<IHierarchy> iInlineHierarchy(_UIDRef_you_have_, IID_IHIERARCHY);
// The first child is the kSplineItemBoss of the nested text frame
InterfacePtr<IHierarchy> iSplineHierarchy(iInlineHierarchy->QueryChild(0));
// kMultiColumnItemBoss
InterfacePtr<IHierarchy> iMultiColumnItemHierarchy(iSplineHierarchy->QueryChild(0));
// kFrameItemBoss
InterfacePtr<IHierarchy> iFrameItemHierarchy(iMultiColumnItemHierarchy->QueryChild(0));
InterfacePtr<IFrameList> iFrameList(iFrameItemHierarchy->QueryFrameList());
InterfacePtr<ITextModel> iTextModel(iFrameList->QueryTextModel());
Now, you have the ITextModel of your nested text frame and you can get the text.
Copy link to clipboard
Copied
Thank you very much for your help. I have an issue with the following:
InterfacePtr<IFrameList> iFrameList(iFrameItemHierarchy->QueryFrameList())
iFrameItemHierarchy has no member QueryFrameList();
Appreciate,
Joe
Copy link to clipboard
Copied
Oops :
InterfacePtr<IHierarchy> iInlineHierarchy(_UIDRef_you_have_, IID_IHIERARCHY);
// The first child is the kSplineItemBoss of the nested text frame
InterfacePtr<IHierarchy> iSplineHierarchy(iInlineHierarchy->QueryChild(0));
// kMultiColumnItemBoss
InterfacePtr<IHierarchy> iMultiColumnItemHierarchy(iSplineHierarchy->QueryChild(0));
// kFrameItemBoss
InterfacePtr<IHierarchy> iFrameItemHierarchy(iMultiColumnItemHierarchy->QueryChild(0));
// I forgot this
InterfacePtr<ITextFrameColumn> iTextFrameColumn(iFrameItemHierarchy, IID_ITEXTFRAMECOLUMN);
InterfacePtr<IFrameList> iFrameList(iTextFrameColumn->QueryFrameList());
InterfacePtr<ITextModel> iTextModel(iFrameList->QueryTextModel());
Copy link to clipboard
Copied
Thank you very much for your help.
That solved the issue!!