Hello,
I've some troubles adding text to structured document after I paste some text from clipboard into it. Here it is how it goes in the code:
...
F_ApiSetTextRange(FV_SessionId, m_docId, FP_TextSelection, &tr);
F_ApiPaste(m_docId, 0);
F_ApiPopClipboard();
...
F_TextLoc addLoc;
addLoc.objId = m_paragraphId;
addLoc.offset = tr.beg.offset + pastedObjectLen;
F_ApiAddText(m_docId, &addLoc, newText);
The object from clipboard (in fact it's cross-reference) is pasted correctly to the right position but no text is added from then on.
pastedObjectLen is length of the cross-reference text (including the element begin/end tags)
I tried more variations of the line:
addLoc.offset = tr.beg.offset + 1;
addLoc.offset = tr.beg.offset + 2;
...
But nothing works.
Can somebody see where the problem lies?
I'm using FrameMaker8.
Thank you!
I've some troubles adding text to structured document after I paste some text from clipboard into it. Here it is how it goes in the code:
...
F_ApiSetTextRange(FV_SessionId, m_docId, FP_TextSelection, &tr);
F_ApiPaste(m_docId, 0);
F_ApiPopClipboard();
...
F_TextLoc addLoc;
addLoc.objId = m_paragraphId;
addLoc.offset = tr.beg.offset + pastedObjectLen;
F_ApiAddText(m_docId, &addLoc, newText);
The object from clipboard (in fact it's cross-reference) is pasted correctly to the right position but no text is added from then on.
pastedObjectLen is length of the cross-reference text (including the element begin/end tags)
I tried more variations of the line:
addLoc.offset = tr.beg.offset + 1;
addLoc.offset = tr.beg.offset + 2;
...
But nothing works.
Can somebody see where the problem lies?
I'm using FrameMaker8.
Thank you!