Loading...
 

CX_WORD_XML

CX_WORD_XML

Class hierarchy
Description:

Objects of this class represent Word documents and support the operations relevant for printing. Since the objects of this class work on an internal structure, working with the objects is more performant than working with OLE objects. The class CX_OLE_WORD_XML offers corresponding functions to convert an OLE object into an XML object and with AsCOM the XML object can be converted back into a CX_COM_OBJECT. Alternatively, the XML objects can be saved in a *.xml file via WriteToFile and opened with Word.

Both functions use the transient range for this. So you do not have to call SaveXMLString to see the latest changes in the result.

Code example:
Var(xml1, xml2)
CreateTransObject(CX_WORD_XML) -> xml1
CreateTransObject(CX_WORD_XML) -> xml2
xml1 Call(EmptyDocument)
xml2 Call(EmptyDocument)

"Erste Seite" xml1 Call(PutText)
xml1 Call(InsertBreak)
"Zweite Seite" xml2 Call(PutText)

xml2 xml1 Call(PutFormattedText)
xml1 Call(AsCOM) Call(CX_Open)
List of methods (MDI)
Function MA* Parameters Return Brief description
AsCOM CX_COM_OBJECT The XML object is converted into a COM object using a temporary file.
EmptyDocument Initialises or overwrites an XML document with an empty Word document.
GetUncompressedXMLBytes STRING Returns the current content of the persistent area of the object.
InsertBreak Appends a page break at the end of the Word document.
LoadFromFile STRING Loads the XML of the specified .docx file.
Merge Merge the plugspace into the document variables of the Word document
PutFormattedText CX_WORD_XML
CX_MULTIPLE_WORD_XML |
CX_COM_OBJECT |
CX_MULTIPLE_COM_OBJECT
Copies the contents of the transferred Word document paragraph by paragraph to the end of the calling Word document.
PutText STRING The lines of the transferred character string are inserted into the document paragraph by paragraph.
SaveToFile STRING Writes the current state of the XML to a .docx file
WriteToFile STRING Writes the transient area of the XML document to the file passed as a parameter.
PutIntoFirstHeader CX_WORD_XML
CX_MULTIPLE_WORD_XML |
CX_COM_OBJECT |
CX_MULTIPLE_COM_OBJECT
Writes the transferred Word document in the header of the first page
PutIntoHeader CX_WORD_XML
CX_MULTIPLE_WORD_XML |
CX_COM_OBJECT |
CX_MULTIPLE_COM_OBJECT
Writes the transferred Word document into each document header
Assign CX_XML_OBJECT Overwrites the content of the calling XML object with the content of the passed XML object
LoadFromString STRING The content of the XML object is replaced by the XML passed in the string
SaveXMLString The transient state of the XML object is recorded in the persistent area
GetDomain INTEGER Domain of this object
GetSiblings COLLECTION All siblings of this object
GetSiblings2 COLLECTION All siblings of this object
SetDomain INTEGER, INTEGER Set domain
Unlink2 Remove this object from the list of objects with validity
VerifySiblings INTEGER Check ring of exchange objects

* MA = Member Access Function

Data directory (DDI)
Data field Type Reference class I* Brief description

* I = Indexable data field

Use in AppsWH
Module Brief description