Home Forums General XMetaL Discussion Need to replace the active document Reply To: Need to replace the active document

Derek Read

Reply to: Need to replace the active document

Based on previous posts I'm guessing you are working with XMAX. Best to do that in each posting so the post makes sense as a stand-alone conversation, unless you link to other postings. If that is not correct please let us know which product you are working with.

You have a few options I can think of:

1) Write your return string to the XMAX-specific Document.Xml property. See Programmer's Guide topic “XMetaL XMAX interfaces” > “Properties” > “Xml”.

2) Close the ActiveDocument and use LoadFromString() to open your return string.

3) Replace the content of the root node in the current document with a similar construction. In this case if your return string is an entire document, including XML prolog (XML declaration and DOCTYPE declaration, etc) then you would need to strip that off.

If you do not wish the user to be able to undo these actions then you can also call UndoClear().