Quantcast
Channel: Adobe Community : Popular Discussions - FrameMaker Structured
Viewing all articles
Browse latest Browse all 66580

Problem with F_ApiAddText() after F_ApiPaste()

$
0
0
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!

Viewing all articles
Browse latest Browse all 66580

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>