OfficeDoc Class

Properties   Methods   Events   Config Settings   Errors  

The OfficeDoc class implements support for the Open XML Packaging Format used in Office 2007 documents.

Syntax

OfficeDoc

Remarks

The class provides a way to extract information and content from an Open XML packaged document, examine the package properties and basic read/update facilities.

Property List


The following is the full list of the properties of the class with short descriptions. Click on the links for further details.

ContentTypeCountThe number of records in the ContentType arrays.
ContentTypeIsOverrideSpecifies if this is a default content type or an override.
ContentTypeMediaTypeThe media type for this entry, as defined by RFC2616.
ContentTypeTargetIf it's a default content type, this will be the file extension it applies to.
NamespaceCountThe number of records in the Namespace arrays.
NamespacePrefixThe Prefix for the Namespace .
NamespaceURINamespace URI associated with the corresponding Prefix .
PackagePathThe path to the Open XML package file.
PackagePropertyCountThe number of records in the PackageProperty arrays.
PackagePropertyDataTypeThe data type associated with this property, if the information is available.
PackagePropertyNameThe name of this property.
PackagePropertyNamespaceThe XML Namespace URI associated with this property.
PackagePropertyPropIdIf this is a custom property, this will be the pid assigned to it.
PackagePropertyPropSetIf this is a custom property, this will be the GUID of the property set it belongs to.
PackagePropertyValueThe value of this property.
PartDataThe contents of the currently selected part.
PartNameThe name of the currently selected part.
RelationshipCountThe number of records in the Relationship arrays.
RelationshipContentTypeThe content type for the part referenced by this relationship, resolved from [Content_Types].
RelationshipIdThe unique ID of this relationship within this .
RelationshipPartNameThe name of the part this relationship entry applies to.
RelationshipTypeURIThe XML namespace URI that specifies the meaning of this relationship.
ValidateThis property controls whether documents are validated during parsing.
AttrCountThe number of records in the Attr arrays.
AttrNameThe Name provides the local name (without prefix) of the attribute.
AttrNamespaceAttribute namespace.
AttrPrefixAttribute prefix (if any).
AttrValueAttribute value.
XChildCountThe number of records in the XChild arrays.
XChildNameThe Name property provides the local name (without prefix) of the element.
XChildNamespaceNamespace of the element.
XChildPrefixPrefix of the element (if any).
XChildXTextThe inner text of the element.
XElementThe name of the current element.
XNamespaceThe namespace of the current element.
XParentThe parent of the current element.
XPathProvides a way to point to a specific element in the document.
XPrefixThe prefix of the current element.
XSubTreeA snapshot of the current element in the document.
XTextThe text of the current element.

Method List


The following is the full list of the methods of the class with short descriptions. Click on the links for further details.

CloseCloses the Open XML package archive.
ConfigSets or retrieves a configuration setting.
ExtractPartReads the contents of the currently selected part.
FindPartByTypeLooks up a part in the current relationships file by it's type namespace URI.
GetPropertyValueReturns the value of the specified package property.
ListPartsList all the parts contained in the document and their relationships.
OpenOpens the Open XML package archive.
ParsePartParses the specified part as XML.
ReadRelationshipsReads the relationships file in the archive associated with the specified part.
ReplacePartReplaces the contents of the specified part in the package.
ResetResets the class.
ResolveContentTypeReturns the content type of the specified part.

Event List


The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.

BeginFileFired before each file is processed.
CharactersFired for plain text segments of the input stream.
CommentFired when a comment section is encountered.
EndElementFired when an end-element tag is encountered.
EndFileFired after each file is processed.
EndPrefixMappingFired when leaving the scope of a namespace declaration.
ErrorInformation about errors during data delivery.
EvalEntityFired every time an entity needs to be evaluated.
IgnorableWhitespaceFired when a section of ignorable whitespace is encountered.
MetaFired when a meta section is encountered.
OverwriteFired whenever a file exists and may be overwritten.
PIFired when a processing instruction section is encountered.
ProgressFired as progress is made.
SpecialSectionFired when a special section is encountered.
StartElementFired when a begin-element tag is encountered in the document.
StartPrefixMappingFired when entering the scope of a namespace declaration.

Config Settings


The following is a list of config settings for the class with short descriptions. Click on the links for further details.

NormalizePartNameWhether to normalize Part Names.
RelationshipIsExternal[x]Whether the relationship part is internal or external.
BuildInfoInformation about the product's build.
CodePageThe system code page used for Unicode to Multibyte translations.
LicenseInfoInformation about the current license.
MaskSensitiveWhether sensitive data is masked in log messages.
ProcessIdleEventsWhether the class uses its internal event loop to process events when the main thread is idle.
SelectWaitMillisThe length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.
UseInternalSecurityAPITells the class whether or not to use the system security libraries or an internal implementation.

ContentTypeCount Property (OfficeDoc Class)

The number of records in the ContentType arrays.

Syntax

ANSI (Cross Platform)
int GetContentTypeCount();

Unicode (Windows)
INT GetContentTypeCount();
int ipworkszip_officedoc_getcontenttypecount(void* lpObj);
int GetContentTypeCount();

Default Value

0

Remarks

This property controls the size of the following arrays:

The array indices start at 0 and end at ContentTypeCount - 1.

This property is read-only and not available at design time.

Data Type

Integer

ContentTypeIsOverride Property (OfficeDoc Class)

Specifies if this is a default content type or an override.

Syntax

ANSI (Cross Platform)
int GetContentTypeIsOverride(int iContentTypeIndex);

Unicode (Windows)
BOOL GetContentTypeIsOverride(INT iContentTypeIndex);
int ipworkszip_officedoc_getcontenttypeisoverride(void* lpObj, int contenttypeindex);
bool GetContentTypeIsOverride(int iContentTypeIndex);

Default Value

TRUE

Remarks

Specifies if this is a default content type or an override.

The ContentTypeIndex parameter specifies the index of the item in the array. The size of the array is controlled by the ContentTypeCount property.

This property is read-only and not available at design time.

Data Type

Boolean

ContentTypeMediaType Property (OfficeDoc Class)

The media type for this entry, as defined by RFC2616.

Syntax

ANSI (Cross Platform)
char* GetContentTypeMediaType(int iContentTypeIndex);

Unicode (Windows)
LPWSTR GetContentTypeMediaType(INT iContentTypeIndex);
char* ipworkszip_officedoc_getcontenttypemediatype(void* lpObj, int contenttypeindex);
QString GetContentTypeMediaType(int iContentTypeIndex);

Default Value

""

Remarks

The media type for this entry, as defined by RFC2616.

The ContentTypeIndex parameter specifies the index of the item in the array. The size of the array is controlled by the ContentTypeCount property.

This property is read-only and not available at design time.

Data Type

String

ContentTypeTarget Property (OfficeDoc Class)

If it's a default content type, this will be the file extension it applies to.

Syntax

ANSI (Cross Platform)
char* GetContentTypeTarget(int iContentTypeIndex);

Unicode (Windows)
LPWSTR GetContentTypeTarget(INT iContentTypeIndex);
char* ipworkszip_officedoc_getcontenttypetarget(void* lpObj, int contenttypeindex);
QString GetContentTypeTarget(int iContentTypeIndex);

Default Value

""

Remarks

If it's a default content type, this will be the file extension it applies to. Otherwise, it will be the part name.

The ContentTypeIndex parameter specifies the index of the item in the array. The size of the array is controlled by the ContentTypeCount property.

This property is read-only and not available at design time.

Data Type

String

NamespaceCount Property (OfficeDoc Class)

The number of records in the Namespace arrays.

Syntax

ANSI (Cross Platform)
int GetNamespaceCount();

Unicode (Windows)
INT GetNamespaceCount();
int ipworkszip_officedoc_getnamespacecount(void* lpObj);
int GetNamespaceCount();

Default Value

0

Remarks

This property controls the size of the following arrays:

The array indices start at 0 and end at NamespaceCount - 1.

This property is read-only and not available at design time.

Data Type

Integer

NamespacePrefix Property (OfficeDoc Class)

The Prefix for the Namespace .

Syntax

ANSI (Cross Platform)
char* GetNamespacePrefix(int iNamespaceIndex);

Unicode (Windows)
LPWSTR GetNamespacePrefix(INT iNamespaceIndex);
char* ipworkszip_officedoc_getnamespaceprefix(void* lpObj, int namespaceindex);
QString GetNamespacePrefix(int iNamespaceIndex);

Default Value

""

Remarks

The NamespacePrefix for the Namespace.

The NamespaceIndex parameter specifies the index of the item in the array. The size of the array is controlled by the NamespaceCount property.

This property is read-only and not available at design time.

Data Type

String

NamespaceURI Property (OfficeDoc Class)

Namespace URI associated with the corresponding Prefix .

Syntax

ANSI (Cross Platform)
char* GetNamespaceURI(int iNamespaceIndex);

Unicode (Windows)
LPWSTR GetNamespaceURI(INT iNamespaceIndex);
char* ipworkszip_officedoc_getnamespaceuri(void* lpObj, int namespaceindex);
QString GetNamespaceURI(int iNamespaceIndex);

Default Value

""

Remarks

Namespace URI associated with the corresponding NamespacePrefix. This is usually a URL pointing to the XML schema for the namespace.

The NamespaceIndex parameter specifies the index of the item in the array. The size of the array is controlled by the NamespaceCount property.

This property is read-only and not available at design time.

Data Type

String

PackagePath Property (OfficeDoc Class)

The path to the Open XML package file.

Syntax

ANSI (Cross Platform)
char* GetPackagePath();
int SetPackagePath(const char* lpszPackagePath); Unicode (Windows) LPWSTR GetPackagePath();
INT SetPackagePath(LPCWSTR lpszPackagePath);
char* ipworkszip_officedoc_getpackagepath(void* lpObj);
int ipworkszip_officedoc_setpackagepath(void* lpObj, const char* lpszPackagePath);
QString GetPackagePath();
int SetPackagePath(QString qsPackagePath);

Default Value

""

Remarks

This property specifies the path and filename of the Open XML package to work on.

Data Type

String

PackagePropertyCount Property (OfficeDoc Class)

The number of records in the PackageProperty arrays.

Syntax

ANSI (Cross Platform)
int GetPackagePropertyCount();

Unicode (Windows)
INT GetPackagePropertyCount();
int ipworkszip_officedoc_getpackagepropertycount(void* lpObj);
int GetPackagePropertyCount();

Default Value

0

Remarks

This property controls the size of the following arrays:

The array indices start at 0 and end at PackagePropertyCount - 1.

This property is read-only and not available at design time.

Data Type

Integer

PackagePropertyDataType Property (OfficeDoc Class)

The data type associated with this property, if the information is available.

Syntax

ANSI (Cross Platform)
char* GetPackagePropertyDataType(int iPackagePropertyIndex);

Unicode (Windows)
LPWSTR GetPackagePropertyDataType(INT iPackagePropertyIndex);
char* ipworkszip_officedoc_getpackagepropertydatatype(void* lpObj, int packagepropertyindex);
QString GetPackagePropertyDataType(int iPackagePropertyIndex);

Default Value

""

Remarks

The data type associated with this property, if the information is available.

The PackagePropertyIndex parameter specifies the index of the item in the array. The size of the array is controlled by the PackagePropertyCount property.

This property is read-only and not available at design time.

Data Type

String

PackagePropertyName Property (OfficeDoc Class)

The name of this property.

Syntax

ANSI (Cross Platform)
char* GetPackagePropertyName(int iPackagePropertyIndex);

Unicode (Windows)
LPWSTR GetPackagePropertyName(INT iPackagePropertyIndex);
char* ipworkszip_officedoc_getpackagepropertyname(void* lpObj, int packagepropertyindex);
QString GetPackagePropertyName(int iPackagePropertyIndex);

Default Value

""

Remarks

The name of this property

The PackagePropertyIndex parameter specifies the index of the item in the array. The size of the array is controlled by the PackagePropertyCount property.

This property is read-only and not available at design time.

Data Type

String

PackagePropertyNamespace Property (OfficeDoc Class)

The XML Namespace URI associated with this property.

Syntax

ANSI (Cross Platform)
char* GetPackagePropertyNamespace(int iPackagePropertyIndex);

Unicode (Windows)
LPWSTR GetPackagePropertyNamespace(INT iPackagePropertyIndex);
char* ipworkszip_officedoc_getpackagepropertynamespace(void* lpObj, int packagepropertyindex);
QString GetPackagePropertyNamespace(int iPackagePropertyIndex);

Default Value

""

Remarks

The XML Namespace URI associated with this property. For custom properties, this will be an empty string.

The PackagePropertyIndex parameter specifies the index of the item in the array. The size of the array is controlled by the PackagePropertyCount property.

This property is read-only and not available at design time.

Data Type

String

PackagePropertyPropId Property (OfficeDoc Class)

If this is a custom property, this will be the pid assigned to it.

Syntax

ANSI (Cross Platform)
char* GetPackagePropertyPropId(int iPackagePropertyIndex);

Unicode (Windows)
LPWSTR GetPackagePropertyPropId(INT iPackagePropertyIndex);
char* ipworkszip_officedoc_getpackagepropertypropid(void* lpObj, int packagepropertyindex);
QString GetPackagePropertyPropId(int iPackagePropertyIndex);

Default Value

""

Remarks

If this is a custom property, this will be the pid assigned to it.

The PackagePropertyIndex parameter specifies the index of the item in the array. The size of the array is controlled by the PackagePropertyCount property.

This property is read-only and not available at design time.

Data Type

String

PackagePropertyPropSet Property (OfficeDoc Class)

If this is a custom property, this will be the GUID of the property set it belongs to.

Syntax

ANSI (Cross Platform)
char* GetPackagePropertyPropSet(int iPackagePropertyIndex);

Unicode (Windows)
LPWSTR GetPackagePropertyPropSet(INT iPackagePropertyIndex);
char* ipworkszip_officedoc_getpackagepropertypropset(void* lpObj, int packagepropertyindex);
QString GetPackagePropertyPropSet(int iPackagePropertyIndex);

Default Value

""

Remarks

If this is a custom property, this will be the GUID of the property set it belongs to.

The PackagePropertyIndex parameter specifies the index of the item in the array. The size of the array is controlled by the PackagePropertyCount property.

This property is read-only and not available at design time.

Data Type

String

PackagePropertyValue Property (OfficeDoc Class)

The value of this property.

Syntax

ANSI (Cross Platform)
char* GetPackagePropertyValue(int iPackagePropertyIndex);

Unicode (Windows)
LPWSTR GetPackagePropertyValue(INT iPackagePropertyIndex);
char* ipworkszip_officedoc_getpackagepropertyvalue(void* lpObj, int packagepropertyindex);
QString GetPackagePropertyValue(int iPackagePropertyIndex);

Default Value

""

Remarks

The value of this property

The PackagePropertyIndex parameter specifies the index of the item in the array. The size of the array is controlled by the PackagePropertyCount property.

This property is read-only and not available at design time.

Data Type

String

PartData Property (OfficeDoc Class)

The contents of the currently selected part.

Syntax

ANSI (Cross Platform)
int GetPartData(char* &lpPartData, int &lenPartData);
int SetPartData(const char* lpPartData, int lenPartData); Unicode (Windows) INT GetPartData(LPSTR &lpPartData, INT &lenPartData);
INT SetPartData(LPCSTR lpPartData, INT lenPartData);
int ipworkszip_officedoc_getpartdata(void* lpObj, char** lpPartData, int* lenPartData);
int ipworkszip_officedoc_setpartdata(void* lpObj, const char* lpPartData, int lenPartData);
QByteArray GetPartData();
int SetPartData(QByteArray qbaPartData);

Default Value

""

Remarks

This property will hold the contents of the part selected by PartName after calling the ExtractPart method. It can also be set before calling ReplacePart.

Data Type

Binary String

PartName Property (OfficeDoc Class)

The name of the currently selected part.

Syntax

ANSI (Cross Platform)
char* GetPartName();
int SetPartName(const char* lpszPartName); Unicode (Windows) LPWSTR GetPartName();
INT SetPartName(LPCWSTR lpszPartName);
char* ipworkszip_officedoc_getpartname(void* lpObj);
int ipworkszip_officedoc_setpartname(void* lpObj, const char* lpszPartName);
QString GetPartName();
int SetPartName(QString qsPartName);

Default Value

""

Remarks

This property specifies the name of the currently selected part in the document. If null or empty, no part is currently selected.

Data Type

String

RelationshipCount Property (OfficeDoc Class)

The number of records in the Relationship arrays.

Syntax

ANSI (Cross Platform)
int GetRelationshipCount();

Unicode (Windows)
INT GetRelationshipCount();
int ipworkszip_officedoc_getrelationshipcount(void* lpObj);
int GetRelationshipCount();

Default Value

0

Remarks

This property controls the size of the following arrays:

The array indices start at 0 and end at RelationshipCount - 1.

This property is read-only and not available at design time.

Data Type

Integer

RelationshipContentType Property (OfficeDoc Class)

The content type for the part referenced by this relationship, resolved from [Content_Types].

Syntax

ANSI (Cross Platform)
char* GetRelationshipContentType(int iRelationshipIndex);

Unicode (Windows)
LPWSTR GetRelationshipContentType(INT iRelationshipIndex);
char* ipworkszip_officedoc_getrelationshipcontenttype(void* lpObj, int relationshipindex);
QString GetRelationshipContentType(int iRelationshipIndex);

Default Value

""

Remarks

The content type for the part referenced by this relationship, resolved from [Content_Types].xml according to the Open XML packaging specification rules.

The RelationshipIndex parameter specifies the index of the item in the array. The size of the array is controlled by the RelationshipCount property.

This property is read-only and not available at design time.

Data Type

String

RelationshipId Property (OfficeDoc Class)

The unique ID of this relationship within this .

Syntax

ANSI (Cross Platform)
char* GetRelationshipId(int iRelationshipIndex);

Unicode (Windows)
LPWSTR GetRelationshipId(INT iRelationshipIndex);
char* ipworkszip_officedoc_getrelationshipid(void* lpObj, int relationshipindex);
QString GetRelationshipId(int iRelationshipIndex);

Default Value

""

Remarks

The unique ID of this relationship within this .rels file

The RelationshipIndex parameter specifies the index of the item in the array. The size of the array is controlled by the RelationshipCount property.

This property is read-only and not available at design time.

Data Type

String

RelationshipPartName Property (OfficeDoc Class)

The name of the part this relationship entry applies to.

Syntax

ANSI (Cross Platform)
char* GetRelationshipPartName(int iRelationshipIndex);

Unicode (Windows)
LPWSTR GetRelationshipPartName(INT iRelationshipIndex);
char* ipworkszip_officedoc_getrelationshippartname(void* lpObj, int relationshipindex);
QString GetRelationshipPartName(int iRelationshipIndex);

Default Value

""

Remarks

The name of the part this relationship entry applies to.

The RelationshipIndex parameter specifies the index of the item in the array. The size of the array is controlled by the RelationshipCount property.

This property is read-only and not available at design time.

Data Type

String

RelationshipTypeURI Property (OfficeDoc Class)

The XML namespace URI that specifies the meaning of this relationship.

Syntax

ANSI (Cross Platform)
char* GetRelationshipTypeURI(int iRelationshipIndex);

Unicode (Windows)
LPWSTR GetRelationshipTypeURI(INT iRelationshipIndex);
char* ipworkszip_officedoc_getrelationshiptypeuri(void* lpObj, int relationshipindex);
QString GetRelationshipTypeURI(int iRelationshipIndex);

Default Value

""

Remarks

The XML namespace URI that specifies the meaning of this relationship.

The RelationshipIndex parameter specifies the index of the item in the array. The size of the array is controlled by the RelationshipCount property.

This property is read-only and not available at design time.

Data Type

String

Validate Property (OfficeDoc Class)

This property controls whether documents are validated during parsing.

Syntax

ANSI (Cross Platform)
int GetValidate();
int SetValidate(int bValidate); Unicode (Windows) BOOL GetValidate();
INT SetValidate(BOOL bValidate);
int ipworkszip_officedoc_getvalidate(void* lpObj);
int ipworkszip_officedoc_setvalidate(void* lpObj, int bValidate);
bool GetValidate();
int SetValidate(bool bValidate);

Default Value

TRUE

Remarks

When true (default) the document will be validated during parsing. To disable validation set Validate to false. Disabling validation may be useful in cases where data can still be parsed even if the document is not well-formed.

Data Type

Boolean

AttrCount Property (OfficeDoc Class)

The number of records in the Attr arrays.

Syntax

ANSI (Cross Platform)
int GetAttrCount();

Unicode (Windows)
INT GetAttrCount();
int ipworkszip_officedoc_getattrcount(void* lpObj);
int GetAttrCount();

Default Value

0

Remarks

This property controls the size of the following arrays:

The array indices start at 0 and end at AttrCount - 1.

This property is read-only and not available at design time.

Data Type

Integer

AttrName Property (OfficeDoc Class)

The Name provides the local name (without prefix) of the attribute.

Syntax

ANSI (Cross Platform)
char* GetAttrName(int iAttrIndex);

Unicode (Windows)
LPWSTR GetAttrName(INT iAttrIndex);
char* ipworkszip_officedoc_getattrname(void* lpObj, int attrindex);
QString GetAttrName(int iAttrIndex);

Default Value

""

Remarks

The AttrName provides the local name (without prefix) of the attribute.

The AttrIndex parameter specifies the index of the item in the array. The size of the array is controlled by the AttrCount property.

This property is read-only and not available at design time.

Data Type

String

AttrNamespace Property (OfficeDoc Class)

Attribute namespace.

Syntax

ANSI (Cross Platform)
char* GetAttrNamespace(int iAttrIndex);

Unicode (Windows)
LPWSTR GetAttrNamespace(INT iAttrIndex);
char* ipworkszip_officedoc_getattrnamespace(void* lpObj, int attrindex);
QString GetAttrNamespace(int iAttrIndex);

Default Value

""

Remarks

Attribute namespace.

The AttrIndex parameter specifies the index of the item in the array. The size of the array is controlled by the AttrCount property.

This property is read-only and not available at design time.

Data Type

String

AttrPrefix Property (OfficeDoc Class)

Attribute prefix (if any).

Syntax

ANSI (Cross Platform)
char* GetAttrPrefix(int iAttrIndex);

Unicode (Windows)
LPWSTR GetAttrPrefix(INT iAttrIndex);
char* ipworkszip_officedoc_getattrprefix(void* lpObj, int attrindex);
QString GetAttrPrefix(int iAttrIndex);

Default Value

""

Remarks

Attribute prefix (if any). If the attribute does not have a prefix, this property is empty.

The AttrIndex parameter specifies the index of the item in the array. The size of the array is controlled by the AttrCount property.

This property is read-only and not available at design time.

Data Type

String

AttrValue Property (OfficeDoc Class)

Attribute value.

Syntax

ANSI (Cross Platform)
char* GetAttrValue(int iAttrIndex);

Unicode (Windows)
LPWSTR GetAttrValue(INT iAttrIndex);
char* ipworkszip_officedoc_getattrvalue(void* lpObj, int attrindex);
QString GetAttrValue(int iAttrIndex);

Default Value

""

Remarks

Attribute value.

The AttrIndex parameter specifies the index of the item in the array. The size of the array is controlled by the AttrCount property.

This property is read-only and not available at design time.

Data Type

String

XChildCount Property (OfficeDoc Class)

The number of records in the XChild arrays.

Syntax

ANSI (Cross Platform)
int GetXChildCount();

Unicode (Windows)
INT GetXChildCount();
int ipworkszip_officedoc_getxchildcount(void* lpObj);
int GetXChildCount();

Default Value

0

Remarks

This property controls the size of the following arrays:

The array indices start at 0 and end at XChildCount - 1.

This property is read-only and not available at design time.

Data Type

Integer

XChildName Property (OfficeDoc Class)

The Name property provides the local name (without prefix) of the element.

Syntax

ANSI (Cross Platform)
char* GetXChildName(int iXChildIndex);

Unicode (Windows)
LPWSTR GetXChildName(INT iXChildIndex);
char* ipworkszip_officedoc_getxchildname(void* lpObj, int xchildindex);
QString GetXChildName(int iXChildIndex);

Default Value

""

Remarks

The XChildName property provides the local name (without prefix) of the element.

The XChildIndex parameter specifies the index of the item in the array. The size of the array is controlled by the XChildCount property.

This property is read-only and not available at design time.

Data Type

String

XChildNamespace Property (OfficeDoc Class)

Namespace of the element.

Syntax

ANSI (Cross Platform)
char* GetXChildNamespace(int iXChildIndex);

Unicode (Windows)
LPWSTR GetXChildNamespace(INT iXChildIndex);
char* ipworkszip_officedoc_getxchildnamespace(void* lpObj, int xchildindex);
QString GetXChildNamespace(int iXChildIndex);

Default Value

""

Remarks

Namespace of the element.

The XChildIndex parameter specifies the index of the item in the array. The size of the array is controlled by the XChildCount property.

This property is read-only and not available at design time.

Data Type

String

XChildPrefix Property (OfficeDoc Class)

Prefix of the element (if any).

Syntax

ANSI (Cross Platform)
char* GetXChildPrefix(int iXChildIndex);

Unicode (Windows)
LPWSTR GetXChildPrefix(INT iXChildIndex);
char* ipworkszip_officedoc_getxchildprefix(void* lpObj, int xchildindex);
QString GetXChildPrefix(int iXChildIndex);

Default Value

""

Remarks

Prefix of the element (if any). If the element does not have a prefix, this property is empty.

The XChildIndex parameter specifies the index of the item in the array. The size of the array is controlled by the XChildCount property.

This property is read-only and not available at design time.

Data Type

String

XChildXText Property (OfficeDoc Class)

The inner text of the element.

Syntax

ANSI (Cross Platform)
char* GetXChildXText(int iXChildIndex);

Unicode (Windows)
LPWSTR GetXChildXText(INT iXChildIndex);
char* ipworkszip_officedoc_getxchildxtext(void* lpObj, int xchildindex);
QString GetXChildXText(int iXChildIndex);

Default Value

""

Remarks

The inner text of the element.

The XChildIndex parameter specifies the index of the item in the array. The size of the array is controlled by the XChildCount property.

This property is read-only and not available at design time.

Data Type

String

XElement Property (OfficeDoc Class)

The name of the current element.

Syntax

ANSI (Cross Platform)
char* GetXElement();

Unicode (Windows)
LPWSTR GetXElement();
char* ipworkszip_officedoc_getxelement(void* lpObj);
QString GetXElement();

Default Value

""

Remarks

The current element is specified via the XPath property.

This property is read-only.

Data Type

String

XNamespace Property (OfficeDoc Class)

The namespace of the current element.

Syntax

ANSI (Cross Platform)
char* GetXNamespace();

Unicode (Windows)
LPWSTR GetXNamespace();
char* ipworkszip_officedoc_getxnamespace(void* lpObj);
QString GetXNamespace();

Default Value

""

Remarks

The current element is specified via the XPath property.

This property is read-only.

Data Type

String

XParent Property (OfficeDoc Class)

The parent of the current element.

Syntax

ANSI (Cross Platform)
char* GetXParent();

Unicode (Windows)
LPWSTR GetXParent();
char* ipworkszip_officedoc_getxparent(void* lpObj);
QString GetXParent();

Default Value

""

Remarks

The current element is specified via the XPath property.

This property is read-only.

Data Type

String

XPath Property (OfficeDoc Class)

Provides a way to point to a specific element in the document.

Syntax

ANSI (Cross Platform)
char* GetXPath();
int SetXPath(const char* lpszXPath); Unicode (Windows) LPWSTR GetXPath();
INT SetXPath(LPCWSTR lpszXPath);
char* ipworkszip_officedoc_getxpath(void* lpObj);
int ipworkszip_officedoc_setxpath(void* lpObj, const char* lpszXPath);
QString GetXPath();
int SetXPath(QString qsXPath);

Default Value

""

Remarks

XPath implements a subset of the XML XPath specification, allowing you to point to specific elements in the XML documents.

The path is a series of one or more element accessors separated by '/'. The path can be absolute (starting with '/') or relative to the current XPath location.

The following are possible values for an element accessor:

'name'A particular element name
name[i]The i-th subelement of the current element with the given name
[i]The i-th subelement of the current element
[last()]The last subelement of the current element
[last()-i]The subelement located at the last location minus i in the current element
name[@attrname="attrvalue"]The subelement containing a particular value for a given attribute (supports single AND double quotes)
..The parent of the current element
When XPath is set to a valid path, XElement points to the name of the element, with XParent, XNamespace, XPrefix, XChildName, XChildNamespace, XChildPrefix, XChildXText, and XText providing other properties of the element. The attributes of the current element are provided in the AttrName, AttrNamespace, AttrPrefix, and AttrValue properties.

BuildDOM must be set to True prior to parsing the document for the XPath functionality to be available.

Example (Setting XPath):

Document rootXML.XPath = "/"
Specific ElementXML.XPath = "/root/SubElement1/SubElement2/"
i-th ChildXML.XPath = "/root/SubElement1[i]"

Data Type

String

XPrefix Property (OfficeDoc Class)

The prefix of the current element.

Syntax

ANSI (Cross Platform)
char* GetXPrefix();

Unicode (Windows)
LPWSTR GetXPrefix();
char* ipworkszip_officedoc_getxprefix(void* lpObj);
QString GetXPrefix();

Default Value

""

Remarks

The current element is specified via the XPath property.

This property is read-only.

Data Type

String

XSubTree Property (OfficeDoc Class)

A snapshot of the current element in the document.

Syntax

ANSI (Cross Platform)
char* GetXSubTree();

Unicode (Windows)
LPWSTR GetXSubTree();
char* ipworkszip_officedoc_getxsubtree(void* lpObj);
QString GetXSubTree();

Default Value

""

Remarks

The current element is specified via the XPath property. In order for this property to work you must have the CacheContent set to true.

This property is read-only.

Data Type

String

XText Property (OfficeDoc Class)

The text of the current element.

Syntax

ANSI (Cross Platform)
char* GetXText();

Unicode (Windows)
LPWSTR GetXText();
char* ipworkszip_officedoc_getxtext(void* lpObj);
QString GetXText();

Default Value

""

Remarks

The current element is specified via the XPath property.

This property is read-only.

Data Type

String

Close Method (OfficeDoc Class)

Closes the Open XML package archive.

Syntax

ANSI (Cross Platform)
int Close();

Unicode (Windows)
INT Close();
int ipworkszip_officedoc_close(void* lpObj);
int Close();

Remarks

When this method is called, the class will close the current archive and release all resources.

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Config Method (OfficeDoc Class)

Sets or retrieves a configuration setting.

Syntax

ANSI (Cross Platform)
char* Config(const char* lpszConfigurationString);

Unicode (Windows)
LPWSTR Config(LPCWSTR lpszConfigurationString);
char* ipworkszip_officedoc_config(void* lpObj, const char* lpszConfigurationString);
QString Config(const QString& qsConfigurationString);

Remarks

Config is a generic method available in every class. It is used to set and retrieve configuration settings for the class.

These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the Config method.

To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.

Error Handling (C++)

This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.

ExtractPart Method (OfficeDoc Class)

Reads the contents of the currently selected part.

Syntax

ANSI (Cross Platform)
int ExtractPart();

Unicode (Windows)
INT ExtractPart();
int ipworkszip_officedoc_extractpart(void* lpObj);
int ExtractPart();

Remarks

If the part specified by the PartName property exists, the corresponding physical file will be extracted from the archive and will be available through the PartData property.

If the part doesn't exists, or it's stored in interleaved format, an error will be raised.

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

FindPartByType Method (OfficeDoc Class)

Looks up a part in the current relationships file by it's type namespace URI.

Syntax

ANSI (Cross Platform)
char* FindPartByType(const char* lpszTypeURI);

Unicode (Windows)
LPWSTR FindPartByType(LPCWSTR lpszTypeURI);
char* ipworkszip_officedoc_findpartbytype(void* lpObj, const char* lpszTypeURI);
QString FindPartByType(const QString& qsTypeURI);

Remarks

If a matching part can be found, it's part name is returned. Otherwise, an empty string is returned.

Error Handling (C++)

This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.

GetPropertyValue Method (OfficeDoc Class)

Returns the value of the specified package property.

Syntax

ANSI (Cross Platform)
char* GetPropertyValue(const char* lpszPropName, const char* lpszPropNamespace);

Unicode (Windows)
LPWSTR GetPropertyValue(LPCWSTR lpszPropName, LPCWSTR lpszPropNamespace);
char* ipworkszip_officedoc_getpropertyvalue(void* lpObj, const char* lpszPropName, const char* lpszPropNamespace);
QString GetPropertyValue(const QString& qsPropName, const QString& qsPropNamespace);

Remarks

Looks up a package property named PropName in namespace PropNamespace in the core and app properties tables and returns it's value, if found.

If the property doesn't exists, an empty string is returned.

For custom properties. use an empty string ("") as the value of the PropNamespace parameter.

Error Handling (C++)

This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.

ListParts Method (OfficeDoc Class)

List all the parts contained in the document and their relationships.

Syntax

ANSI (Cross Platform)
int ListParts();

Unicode (Windows)
INT ListParts();
int ipworkszip_officedoc_listparts(void* lpObj);
int ListParts();

Remarks

When this method is called, the class will read all the relationships in the document, recursively, and populate the Relationships collection.

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Open Method (OfficeDoc Class)

Opens the Open XML package archive.

Syntax

ANSI (Cross Platform)
int Open();

Unicode (Windows)
INT Open();
int ipworkszip_officedoc_open(void* lpObj);
int Open();

Remarks

When this method is called, the class will attempt to open the archive specified in PackagePath and extract package properties, content types and parse the master relationships file in the archive.

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

ParsePart Method (OfficeDoc Class)

Parses the specified part as XML.

Syntax

ANSI (Cross Platform)
int ParsePart();

Unicode (Windows)
INT ParsePart();
int ipworkszip_officedoc_parsepart(void* lpObj);
int ParsePart();

Remarks

If the part specified by PartName exists, the corresponding physical file will be extracted from the archive and parsed as XML. If BuildDOM is enabled, the DOM will be built internally and you can use XPath to query the resulting document, using the XPath property. If BuildDOM is disabled, only the XML parser-related events will be fired.

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

ReadRelationships Method (OfficeDoc Class)

Reads the relationships file in the archive associated with the specified part.

Syntax

ANSI (Cross Platform)
int ReadRelationships();

Unicode (Windows)
INT ReadRelationships();
int ipworkszip_officedoc_readrelationships(void* lpObj);
int ReadRelationships();

Remarks

When this method is called, the class will look for a .rels file associated with the part specified by the PartName property. If found, the Relationships collection will now expose the contents of the relationships for that part.

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

ReplacePart Method (OfficeDoc Class)

Replaces the contents of the specified part in the package.

Syntax

ANSI (Cross Platform)
int ReplacePart();

Unicode (Windows)
INT ReplacePart();
int ipworkszip_officedoc_replacepart(void* lpObj);
int ReplacePart();

Remarks

If the part specified by the PartName property exists, the corresponding physical file will be replaced with the contents of the PartData property. The package file will be modified in place right away.

If the part doesn't exists, it's stored in interleaved format, or PartData is null or empty, an error will be raised.

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Reset Method (OfficeDoc Class)

Resets the class.

Syntax

ANSI (Cross Platform)
int Reset();

Unicode (Windows)
INT Reset();
int ipworkszip_officedoc_reset(void* lpObj);
int Reset();

Remarks

Reset resets the state of the class. All properties will be set to their default values, and any files open will be closed.

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

ResolveContentType Method (OfficeDoc Class)

Returns the content type of the specified part.

Syntax

ANSI (Cross Platform)
char* ResolveContentType();

Unicode (Windows)
LPWSTR ResolveContentType();
char* ipworkszip_officedoc_resolvecontenttype(void* lpObj);
QString ResolveContentType();

Remarks

Applies the content type resolution rules specified in the Open XML packaging specification and returns the content type associated with PartName in the archive.

If there's no content type mapped for the part or for the extension, an empty string is returned.

Error Handling (C++)

This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.

BeginFile Event (OfficeDoc Class)

Fired before each file is processed.

Syntax

ANSI (Cross Platform)
virtual int FireBeginFile(OfficeDocBeginFileEventParams *e);
typedef struct {
int Index;
int Skip; int reserved; } OfficeDocBeginFileEventParams;
Unicode (Windows) virtual INT FireBeginFile(OfficeDocBeginFileEventParams *e);
typedef struct {
INT Index;
BOOL Skip; INT reserved; } OfficeDocBeginFileEventParams;
#define EID_OFFICEDOC_BEGINFILE 1

virtual INT IPWORKSZIP_CALL FireBeginFile(INT &iIndex, BOOL &bSkip);
class OfficeDocBeginFileEventParams {
public:
  int Index();

  bool Skip();
  void SetSkip(bool bSkip);

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void BeginFile(OfficeDocBeginFileEventParams *e);
// Or, subclass OfficeDoc and override this emitter function. virtual int FireBeginFile(OfficeDocBeginFileEventParams *e) {...}

Remarks

BeginFile is fired before each file is processed by the compressor or decompressor, as appropriate. Index contains the array index of the file about to be processed, and the FileCompressedName, FileDecompressedName, FileCompressedSize (decompression only), and FileDecompressedSize fields of the Files collection for this index contain more detailed information about the file about to be processed.

When extracting, an alternate location may be specified by trapping the event, and modifying FileDecompressedName and/or ExtractToPath. If FileDecompressedName is set to an empty string, the file will not be written to disk. If WriteToProgressEvent is true, the file will still be decompressed, and the data may be extracted through the Progress event.

This event may also be trapped while compressing. FileCompressedName and FileDecompressedName may be changed.

You may set the Skip parameter to true in order to skip the file completely while compressing or extracting.

Characters Event (OfficeDoc Class)

Fired for plain text segments of the input stream.

Syntax

ANSI (Cross Platform)
virtual int FireCharacters(OfficeDocCharactersEventParams *e);
typedef struct {
const char *Text; int reserved; } OfficeDocCharactersEventParams;
Unicode (Windows) virtual INT FireCharacters(OfficeDocCharactersEventParams *e);
typedef struct {
LPCWSTR Text; INT reserved; } OfficeDocCharactersEventParams;
#define EID_OFFICEDOC_CHARACTERS 2

virtual INT IPWORKSZIP_CALL FireCharacters(LPSTR &lpszText);
class OfficeDocCharactersEventParams {
public:
  const QString &Text();

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void Characters(OfficeDocCharactersEventParams *e);
// Or, subclass OfficeDoc and override this emitter function. virtual int FireCharacters(OfficeDocCharactersEventParams *e) {...}

Remarks

The Characters event provides the plain text content of the XML document (i.e. the text inside the tags). The text is provided through the Text parameter.

The text includes white space as well as end of line characters, except for ignorable whitespace which is fired through the IgnorableWhitespace event.

Comment Event (OfficeDoc Class)

Fired when a comment section is encountered.

Syntax

ANSI (Cross Platform)
virtual int FireComment(OfficeDocCommentEventParams *e);
typedef struct {
const char *Text; int reserved; } OfficeDocCommentEventParams;
Unicode (Windows) virtual INT FireComment(OfficeDocCommentEventParams *e);
typedef struct {
LPCWSTR Text; INT reserved; } OfficeDocCommentEventParams;
#define EID_OFFICEDOC_COMMENT 3

virtual INT IPWORKSZIP_CALL FireComment(LPSTR &lpszText);
class OfficeDocCommentEventParams {
public:
  const QString &Text();

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void Comment(OfficeDocCommentEventParams *e);
// Or, subclass OfficeDoc and override this emitter function. virtual int FireComment(OfficeDocCommentEventParams *e) {...}

Remarks

The Comment event is fired whenever a comment section (<!-- ..text... -->) is found in the document.

The full text of the comment is provided by the Text parameter.

EndElement Event (OfficeDoc Class)

Fired when an end-element tag is encountered.

Syntax

ANSI (Cross Platform)
virtual int FireEndElement(OfficeDocEndElementEventParams *e);
typedef struct {
const char *Namespace;
const char *Element;
const char *QName;
int IsEmpty; int reserved; } OfficeDocEndElementEventParams;
Unicode (Windows) virtual INT FireEndElement(OfficeDocEndElementEventParams *e);
typedef struct {
LPCWSTR Namespace;
LPCWSTR Element;
LPCWSTR QName;
BOOL IsEmpty; INT reserved; } OfficeDocEndElementEventParams;
#define EID_OFFICEDOC_ENDELEMENT 4

virtual INT IPWORKSZIP_CALL FireEndElement(LPSTR &lpszNamespace, LPSTR &lpszElement, LPSTR &lpszQName, BOOL &bIsEmpty);
class OfficeDocEndElementEventParams {
public:
  const QString &Namespace();

  const QString &Element();

  const QString &QName();

  bool IsEmpty();

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void EndElement(OfficeDocEndElementEventParams *e);
// Or, subclass OfficeDoc and override this emitter function. virtual int FireEndElement(OfficeDocEndElementEventParams *e) {...}

Remarks

The EndElement event is fired when an end-element tag is found in the document.

The element name is provided by the Element parameter.

The IsEmpty parameter is true when the event corresponds with an empty element declaration.

EndFile Event (OfficeDoc Class)

Fired after each file is processed.

Syntax

ANSI (Cross Platform)
virtual int FireEndFile(OfficeDocEndFileEventParams *e);
typedef struct {
int Index; int reserved; } OfficeDocEndFileEventParams;
Unicode (Windows) virtual INT FireEndFile(OfficeDocEndFileEventParams *e);
typedef struct {
INT Index; INT reserved; } OfficeDocEndFileEventParams;
#define EID_OFFICEDOC_ENDFILE 5

virtual INT IPWORKSZIP_CALL FireEndFile(INT &iIndex);
class OfficeDocEndFileEventParams {
public:
  int Index();

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void EndFile(OfficeDocEndFileEventParams *e);
// Or, subclass OfficeDoc and override this emitter function. virtual int FireEndFile(OfficeDocEndFileEventParams *e) {...}

Remarks

EndFile is fired after each file is processed by the compressor or decompressor, as appropriate. Index contains the array index of the file processed, and the FileCompressedName, FileDecompressedName, FileCompressedSize, and FileDecompressedSize fields in the Files collection for this index contain more detailed information about the file processed.

EndPrefixMapping Event (OfficeDoc Class)

Fired when leaving the scope of a namespace declaration.

Syntax

ANSI (Cross Platform)
virtual int FireEndPrefixMapping(OfficeDocEndPrefixMappingEventParams *e);
typedef struct {
const char *Prefix; int reserved; } OfficeDocEndPrefixMappingEventParams;
Unicode (Windows) virtual INT FireEndPrefixMapping(OfficeDocEndPrefixMappingEventParams *e);
typedef struct {
LPCWSTR Prefix; INT reserved; } OfficeDocEndPrefixMappingEventParams;
#define EID_OFFICEDOC_ENDPREFIXMAPPING 6

virtual INT IPWORKSZIP_CALL FireEndPrefixMapping(LPSTR &lpszPrefix);
class OfficeDocEndPrefixMappingEventParams {
public:
  const QString &Prefix();

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void EndPrefixMapping(OfficeDocEndPrefixMappingEventParams *e);
// Or, subclass OfficeDoc and override this emitter function. virtual int FireEndPrefixMapping(OfficeDocEndPrefixMappingEventParams *e) {...}

Remarks

The StartPrefixMapping event is fired when entering the scope of a namespace declaration.

Error Event (OfficeDoc Class)

Information about errors during data delivery.

Syntax

ANSI (Cross Platform)
virtual int FireError(OfficeDocErrorEventParams *e);
typedef struct {
int ErrorCode;
const char *Description; int reserved; } OfficeDocErrorEventParams;
Unicode (Windows) virtual INT FireError(OfficeDocErrorEventParams *e);
typedef struct {
INT ErrorCode;
LPCWSTR Description; INT reserved; } OfficeDocErrorEventParams;
#define EID_OFFICEDOC_ERROR 7

virtual INT IPWORKSZIP_CALL FireError(INT &iErrorCode, LPSTR &lpszDescription);
class OfficeDocErrorEventParams {
public:
  int ErrorCode();

  const QString &Description();

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void Error(OfficeDocErrorEventParams *e);
// Or, subclass OfficeDoc and override this emitter function. virtual int FireError(OfficeDocErrorEventParams *e) {...}

Remarks

The Error event is fired in case of exceptional conditions during message processing. Normally the class fails with an error.

The ErrorCode parameter contains an error code, and the Description parameter contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the Error Codes section.

EvalEntity Event (OfficeDoc Class)

Fired every time an entity needs to be evaluated.

Syntax

ANSI (Cross Platform)
virtual int FireEvalEntity(OfficeDocEvalEntityEventParams *e);
typedef struct {
const char *Entity;
char *Value; int reserved; } OfficeDocEvalEntityEventParams;
Unicode (Windows) virtual INT FireEvalEntity(OfficeDocEvalEntityEventParams *e);
typedef struct {
LPCWSTR Entity;
LPWSTR Value; INT reserved; } OfficeDocEvalEntityEventParams;
#define EID_OFFICEDOC_EVALENTITY 8

virtual INT IPWORKSZIP_CALL FireEvalEntity(LPSTR &lpszEntity, LPSTR &lpszValue);
class OfficeDocEvalEntityEventParams {
public:
  const QString &Entity();

  const QString &Value();
  void SetValue(const QString &qsValue);

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void EvalEntity(OfficeDocEvalEntityEventParams *e);
// Or, subclass OfficeDoc and override this emitter function. virtual int FireEvalEntity(OfficeDocEvalEntityEventParams *e) {...}

Remarks

The Value parameter contains a suggested value for the entity (normally the entity name itself). You may set Value to a value of your choice, which will be later passed into the text stream.

IgnorableWhitespace Event (OfficeDoc Class)

Fired when a section of ignorable whitespace is encountered.

Syntax

ANSI (Cross Platform)
virtual int FireIgnorableWhitespace(OfficeDocIgnorableWhitespaceEventParams *e);
typedef struct {
const char *Text; int reserved; } OfficeDocIgnorableWhitespaceEventParams;
Unicode (Windows) virtual INT FireIgnorableWhitespace(OfficeDocIgnorableWhitespaceEventParams *e);
typedef struct {
LPCWSTR Text; INT reserved; } OfficeDocIgnorableWhitespaceEventParams;
#define EID_OFFICEDOC_IGNORABLEWHITESPACE 9

virtual INT IPWORKSZIP_CALL FireIgnorableWhitespace(LPSTR &lpszText);
class OfficeDocIgnorableWhitespaceEventParams {
public:
  const QString &Text();

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void IgnorableWhitespace(OfficeDocIgnorableWhitespaceEventParams *e);
// Or, subclass OfficeDoc and override this emitter function. virtual int FireIgnorableWhitespace(OfficeDocIgnorableWhitespaceEventParams *e) {...}

Remarks

The ignorable whitespace section is provided by the Text parameter.

Meta Event (OfficeDoc Class)

Fired when a meta section is encountered.

Syntax

ANSI (Cross Platform)
virtual int FireMeta(OfficeDocMetaEventParams *e);
typedef struct {
const char *Text; int reserved; } OfficeDocMetaEventParams;
Unicode (Windows) virtual INT FireMeta(OfficeDocMetaEventParams *e);
typedef struct {
LPCWSTR Text; INT reserved; } OfficeDocMetaEventParams;
#define EID_OFFICEDOC_META 10

virtual INT IPWORKSZIP_CALL FireMeta(LPSTR &lpszText);
class OfficeDocMetaEventParams {
public:
  const QString &Text();

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void Meta(OfficeDocMetaEventParams *e);
// Or, subclass OfficeDoc and override this emitter function. virtual int FireMeta(OfficeDocMetaEventParams *e) {...}

Remarks

The Meta event is fired whenever a meta information section (<! ..text... >) is found in the document.

The full text of the meta section is provided by the Text parameter.

Overwrite Event (OfficeDoc Class)

Fired whenever a file exists and may be overwritten.

Syntax

ANSI (Cross Platform)
virtual int FireOverwrite(OfficeDocOverwriteEventParams *e);
typedef struct {
char *Filename;
int Overwrite; int reserved; } OfficeDocOverwriteEventParams;
Unicode (Windows) virtual INT FireOverwrite(OfficeDocOverwriteEventParams *e);
typedef struct {
LPWSTR Filename;
BOOL Overwrite; INT reserved; } OfficeDocOverwriteEventParams;
#define EID_OFFICEDOC_OVERWRITE 11

virtual INT IPWORKSZIP_CALL FireOverwrite(LPSTR &lpszFilename, BOOL &bOverwrite);
class OfficeDocOverwriteEventParams {
public:
  const QString &Filename();
  void SetFilename(const QString &qsFilename);

  bool Overwrite();
  void SetOverwrite(bool bOverwrite);

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void Overwrite(OfficeDocOverwriteEventParams *e);
// Or, subclass OfficeDoc and override this emitter function. virtual int FireOverwrite(OfficeDocOverwriteEventParams *e) {...}

Remarks

Overwrite is fired when a file is about to be overwritten, and would overwrite an existing file. The event is fired during decompression.

Filename contains the full name of the file, specified with its pathname.

Overwrite specifies whether or not the file will be overwritten. For Zip, Jar, and Tar, this is equal by default to the value of the OverwriteFiles property. For Gzip, this value defaults to true.

Either of the parameters may be changed when the event is fired. Changing the value of Overwrite will override the default behavior of the class, and cause the file to be overwritten or not overwritten, depending on the value set. If Filename is changed, the value of Overwrite will be ignored, and the file will be written with the specified name. If a file of the new name also exists this file will be silently overwritten.

PI Event (OfficeDoc Class)

Fired when a processing instruction section is encountered.

Syntax

ANSI (Cross Platform)
virtual int FirePI(OfficeDocPIEventParams *e);
typedef struct {
const char *Text; int reserved; } OfficeDocPIEventParams;
Unicode (Windows) virtual INT FirePI(OfficeDocPIEventParams *e);
typedef struct {
LPCWSTR Text; INT reserved; } OfficeDocPIEventParams;
#define EID_OFFICEDOC_PI 12

virtual INT IPWORKSZIP_CALL FirePI(LPSTR &lpszText);
class OfficeDocPIEventParams {
public:
  const QString &Text();

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void PI(OfficeDocPIEventParams *e);
// Or, subclass OfficeDoc and override this emitter function. virtual int FirePI(OfficeDocPIEventParams *e) {...}

Remarks

The PI event is fired whenever a processing instruction section (<? ..text... ?>) is found in the document.

The full text of the processing instruction is provided by the Text parameter.

Progress Event (OfficeDoc Class)

Fired as progress is made.

Syntax

ANSI (Cross Platform)
virtual int FireProgress(OfficeDocProgressEventParams *e);
typedef struct {
const char *Data; int lenData;
const char *Filename;
int64 BytesProcessed;
int PercentProcessed; int reserved; } OfficeDocProgressEventParams;
Unicode (Windows) virtual INT FireProgress(OfficeDocProgressEventParams *e);
typedef struct {
LPCSTR Data; INT lenData;
LPCWSTR Filename;
LONG64 BytesProcessed;
INT PercentProcessed; INT reserved; } OfficeDocProgressEventParams;
#define EID_OFFICEDOC_PROGRESS 13

virtual INT IPWORKSZIP_CALL FireProgress(LPSTR &lpData, INT &lenData, LPSTR &lpszFilename, LONG64 &lBytesProcessed, INT &iPercentProcessed);
class OfficeDocProgressEventParams {
public:
  const QByteArray &Data();

  const QString &Filename();

  qint64 BytesProcessed();

  int PercentProcessed();

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void Progress(OfficeDocProgressEventParams *e);
// Or, subclass OfficeDoc and override this emitter function. virtual int FireProgress(OfficeDocProgressEventParams *e) {...}

Remarks

The Progress event is automatically fired as compression or decompression is performed. When WriteToProgressEvent is true, the output data is provided through the Data parameter, allowing for it to be streamed out.

Filename contains the name of the file being written. If no file is being written, Filename will contain an empty string, and the output data will be provided exclusively through this event.

BytesProcessed contains the total number of uncompressed bytes processed. PercentProcessed contains the percent of uncompressed bytes processed, corresponding roughly to the running time of the operation.

For Gzip extraction only, BytesProcessed and PercentProcessed will reflect the number of compressed bytes extracted, as it is generally impossible to predetermine the total uncompressed size.

If WriteToProgressEvent is false, Data will contain null.

SpecialSection Event (OfficeDoc Class)

Fired when a special section is encountered.

Syntax

ANSI (Cross Platform)
virtual int FireSpecialSection(OfficeDocSpecialSectionEventParams *e);
typedef struct {
const char *SectionId;
const char *Text; int reserved; } OfficeDocSpecialSectionEventParams;
Unicode (Windows) virtual INT FireSpecialSection(OfficeDocSpecialSectionEventParams *e);
typedef struct {
LPCWSTR SectionId;
LPCWSTR Text; INT reserved; } OfficeDocSpecialSectionEventParams;
#define EID_OFFICEDOC_SPECIALSECTION 14

virtual INT IPWORKSZIP_CALL FireSpecialSection(LPSTR &lpszSectionId, LPSTR &lpszText);
class OfficeDocSpecialSectionEventParams {
public:
  const QString &SectionId();

  const QString &Text();

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void SpecialSection(OfficeDocSpecialSectionEventParams *e);
// Or, subclass OfficeDoc and override this emitter function. virtual int FireSpecialSection(OfficeDocSpecialSectionEventParams *e) {...}

Remarks

The SpecialSection event is fired whenever a special section (such as <![ CDATA [ ..text... ]]>) is found in the document.

The full text of the special section is provided by the Text parameter, while the SectionId parameter provides the section identifier (e.g. "CDATA").

StartElement Event (OfficeDoc Class)

Fired when a begin-element tag is encountered in the document.

Syntax

ANSI (Cross Platform)
virtual int FireStartElement(OfficeDocStartElementEventParams *e);
typedef struct {
const char *Namespace;
const char *Element;
const char *QName;
int IsEmpty; int reserved; } OfficeDocStartElementEventParams;
Unicode (Windows) virtual INT FireStartElement(OfficeDocStartElementEventParams *e);
typedef struct {
LPCWSTR Namespace;
LPCWSTR Element;
LPCWSTR QName;
BOOL IsEmpty; INT reserved; } OfficeDocStartElementEventParams;
#define EID_OFFICEDOC_STARTELEMENT 15

virtual INT IPWORKSZIP_CALL FireStartElement(LPSTR &lpszNamespace, LPSTR &lpszElement, LPSTR &lpszQName, BOOL &bIsEmpty);
class OfficeDocStartElementEventParams {
public:
  const QString &Namespace();

  const QString &Element();

  const QString &QName();

  bool IsEmpty();

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void StartElement(OfficeDocStartElementEventParams *e);
// Or, subclass OfficeDoc and override this emitter function. virtual int FireStartElement(OfficeDocStartElementEventParams *e) {...}

Remarks

The StartElement event is fired when a begin-element tag is found in the document.

The element name is provided through the Element parameter. The attribute names and values (if any) are provided through the AttrName, AttrNamespace, AttrPrefix, and AttrValue properties.

The IsEmpty parameter is true when the event corresponds with an empty element declaration.

StartPrefixMapping Event (OfficeDoc Class)

Fired when entering the scope of a namespace declaration.

Syntax

ANSI (Cross Platform)
virtual int FireStartPrefixMapping(OfficeDocStartPrefixMappingEventParams *e);
typedef struct {
const char *Prefix;
const char *URI; int reserved; } OfficeDocStartPrefixMappingEventParams;
Unicode (Windows) virtual INT FireStartPrefixMapping(OfficeDocStartPrefixMappingEventParams *e);
typedef struct {
LPCWSTR Prefix;
LPCWSTR URI; INT reserved; } OfficeDocStartPrefixMappingEventParams;
#define EID_OFFICEDOC_STARTPREFIXMAPPING 16

virtual INT IPWORKSZIP_CALL FireStartPrefixMapping(LPSTR &lpszPrefix, LPSTR &lpszURI);
class OfficeDocStartPrefixMappingEventParams {
public:
  const QString &Prefix();

  const QString &URI();

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void StartPrefixMapping(OfficeDocStartPrefixMappingEventParams *e);
// Or, subclass OfficeDoc and override this emitter function. virtual int FireStartPrefixMapping(OfficeDocStartPrefixMappingEventParams *e) {...}

Remarks

The EndPrefixMapping event is fired when leaving the scope of a namespace declaration.

Config Settings (OfficeDoc Class)

The class accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the Config method.

OfficeDoc Config Settings

NormalizePartName:   Whether to normalize Part Names.

Sometimes the Part Names retrieved from a document will be of a format that is not directly usable in the PartName property when retrieving the part. For example: /ppt/slides/../media/image1.jpeg

When this option is set to True the component will automatically normalize these Part Names so that they can be directly used in the PartName property for retrieving the part. For example, the above would become: /ppt/media/image1.jpeg

The default is True.

RelationshipIsExternal[x]:   Whether the relationship part is internal or external.

Some relationships in an Office document may be external items, such as URLs and files on disk. These relationships are not directly accessible via ExtractPart. This configuration option will return "1" if the relationship at index "x" of the Relationship* arrays is an external part. Otherwise it will return "0"

Base Config Settings

BuildInfo:   Information about the product's build.

When queried, this setting will return a string containing information about the product's build.

CodePage:   The system code page used for Unicode to Multibyte translations.

The default code page is Unicode UTF-8 (65001).

The following is a list of valid code page identifiers:

IdentifierName
037IBM EBCDIC - U.S./Canada
437OEM - United States
500IBM EBCDIC - International
708Arabic - ASMO 708
709Arabic - ASMO 449+, BCON V4
710Arabic - Transparent Arabic
720Arabic - Transparent ASMO
737OEM - Greek (formerly 437G)
775OEM - Baltic
850OEM - Multilingual Latin I
852OEM - Latin II
855OEM - Cyrillic (primarily Russian)
857OEM - Turkish
858OEM - Multilingual Latin I + Euro symbol
860OEM - Portuguese
861OEM - Icelandic
862OEM - Hebrew
863OEM - Canadian-French
864OEM - Arabic
865OEM - Nordic
866OEM - Russian
869OEM - Modern Greek
870IBM EBCDIC - Multilingual/ROECE (Latin-2)
874ANSI/OEM - Thai (same as 28605, ISO 8859-15)
875IBM EBCDIC - Modern Greek
932ANSI/OEM - Japanese, Shift-JIS
936ANSI/OEM - Simplified Chinese (PRC, Singapore)
949ANSI/OEM - Korean (Unified Hangul Code)
950ANSI/OEM - Traditional Chinese (Taiwan; Hong Kong SAR, PRC)
1026IBM EBCDIC - Turkish (Latin-5)
1047IBM EBCDIC - Latin 1/Open System
1140IBM EBCDIC - U.S./Canada (037 + Euro symbol)
1141IBM EBCDIC - Germany (20273 + Euro symbol)
1142IBM EBCDIC - Denmark/Norway (20277 + Euro symbol)
1143IBM EBCDIC - Finland/Sweden (20278 + Euro symbol)
1144IBM EBCDIC - Italy (20280 + Euro symbol)
1145IBM EBCDIC - Latin America/Spain (20284 + Euro symbol)
1146IBM EBCDIC - United Kingdom (20285 + Euro symbol)
1147IBM EBCDIC - France (20297 + Euro symbol)
1148IBM EBCDIC - International (500 + Euro symbol)
1149IBM EBCDIC - Icelandic (20871 + Euro symbol)
1200Unicode UCS-2 Little-Endian (BMP of ISO 10646)
1201Unicode UCS-2 Big-Endian
1250ANSI - Central European
1251ANSI - Cyrillic
1252ANSI - Latin I
1253ANSI - Greek
1254ANSI - Turkish
1255ANSI - Hebrew
1256ANSI - Arabic
1257ANSI - Baltic
1258ANSI/OEM - Vietnamese
1361Korean (Johab)
10000MAC - Roman
10001MAC - Japanese
10002MAC - Traditional Chinese (Big5)
10003MAC - Korean
10004MAC - Arabic
10005MAC - Hebrew
10006MAC - Greek I
10007MAC - Cyrillic
10008MAC - Simplified Chinese (GB 2312)
10010MAC - Romania
10017MAC - Ukraine
10021MAC - Thai
10029MAC - Latin II
10079MAC - Icelandic
10081MAC - Turkish
10082MAC - Croatia
12000Unicode UCS-4 Little-Endian
12001Unicode UCS-4 Big-Endian
20000CNS - Taiwan
20001TCA - Taiwan
20002Eten - Taiwan
20003IBM5550 - Taiwan
20004TeleText - Taiwan
20005Wang - Taiwan
20105IA5 IRV International Alphabet No. 5 (7-bit)
20106IA5 German (7-bit)
20107IA5 Swedish (7-bit)
20108IA5 Norwegian (7-bit)
20127US-ASCII (7-bit)
20261T.61
20269ISO 6937 Non-Spacing Accent
20273IBM EBCDIC - Germany
20277IBM EBCDIC - Denmark/Norway
20278IBM EBCDIC - Finland/Sweden
20280IBM EBCDIC - Italy
20284IBM EBCDIC - Latin America/Spain
20285IBM EBCDIC - United Kingdom
20290IBM EBCDIC - Japanese Katakana Extended
20297IBM EBCDIC - France
20420IBM EBCDIC - Arabic
20423IBM EBCDIC - Greek
20424IBM EBCDIC - Hebrew
20833IBM EBCDIC - Korean Extended
20838IBM EBCDIC - Thai
20866Russian - KOI8-R
20871IBM EBCDIC - Icelandic
20880IBM EBCDIC - Cyrillic (Russian)
20905IBM EBCDIC - Turkish
20924IBM EBCDIC - Latin-1/Open System (1047 + Euro symbol)
20932JIS X 0208-1990 & 0121-1990
20936Simplified Chinese (GB2312)
21025IBM EBCDIC - Cyrillic (Serbian, Bulgarian)
21027Extended Alpha Lowercase
21866Ukrainian (KOI8-U)
28591ISO 8859-1 Latin I
28592ISO 8859-2 Central Europe
28593ISO 8859-3 Latin 3
28594ISO 8859-4 Baltic
28595ISO 8859-5 Cyrillic
28596ISO 8859-6 Arabic
28597ISO 8859-7 Greek
28598ISO 8859-8 Hebrew
28599ISO 8859-9 Latin 5
28605ISO 8859-15 Latin 9
29001Europa 3
38598ISO 8859-8 Hebrew
50220ISO 2022 Japanese with no halfwidth Katakana
50221ISO 2022 Japanese with halfwidth Katakana
50222ISO 2022 Japanese JIS X 0201-1989
50225ISO 2022 Korean
50227ISO 2022 Simplified Chinese
50229ISO 2022 Traditional Chinese
50930Japanese (Katakana) Extended
50931US/Canada and Japanese
50933Korean Extended and Korean
50935Simplified Chinese Extended and Simplified Chinese
50936Simplified Chinese
50937US/Canada and Traditional Chinese
50939Japanese (Latin) Extended and Japanese
51932EUC - Japanese
51936EUC - Simplified Chinese
51949EUC - Korean
51950EUC - Traditional Chinese
52936HZ-GB2312 Simplified Chinese
54936Windows XP: GB18030 Simplified Chinese (4 Byte)
57002ISCII Devanagari
57003ISCII Bengali
57004ISCII Tamil
57005ISCII Telugu
57006ISCII Assamese
57007ISCII Oriya
57008ISCII Kannada
57009ISCII Malayalam
57010ISCII Gujarati
57011ISCII Punjabi
65000Unicode UTF-7
65001Unicode UTF-8
The following is a list of valid code page identifiers for Mac OS only:
IdentifierName
1ASCII
2NEXTSTEP
3JapaneseEUC
4UTF8
5ISOLatin1
6Symbol
7NonLossyASCII
8ShiftJIS
9ISOLatin2
10Unicode
11WindowsCP1251
12WindowsCP1252
13WindowsCP1253
14WindowsCP1254
15WindowsCP1250
21ISO2022JP
30MacOSRoman
10UTF16String
0x90000100UTF16BigEndian
0x94000100UTF16LittleEndian
0x8c000100UTF32String
0x98000100UTF32BigEndian
0x9c000100UTF32LittleEndian
65536Proprietary

LicenseInfo:   Information about the current license.

When queried, this setting will return a string containing information about the license this instance of a class is using. It will return the following information:

  • Product: The product the license is for.
  • Product Key: The key the license was generated from.
  • License Source: Where the license was found (e.g., RuntimeLicense, License File).
  • License Type: The type of license installed (e.g., Royalty Free, Single Server).
  • Last Valid Build: The last valid build number for which the license will work.
MaskSensitive:   Whether sensitive data is masked in log messages.

In certain circumstances it may be beneficial to mask sensitive data, like passwords, in log messages. Set this to true to mask sensitive data. The default is true.

This setting only works on these classes: AS3Receiver, AS3Sender, Atom, Client(3DS), FTP, FTPServer, IMAP, OFTPClient, SSHClient, SCP, Server(3DS), Sexec, SFTP, SFTPServer, SSHServer, TCPClient, TCPServer.

ProcessIdleEvents:   Whether the class uses its internal event loop to process events when the main thread is idle.

If set to False, the class will not fire internal idle events. Set this to False to use the class in a background thread on Mac OS. By default, this setting is True.

SelectWaitMillis:   The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.

If there are no events to process when DoEvents is called, the class will wait for the amount of time specified here before returning. The default value is 20.

UseInternalSecurityAPI:   Whether or not to use the system security libraries or an internal implementation.

When set to false, the class will use the system security libraries by default to perform cryptographic functions where applicable.

Setting this configuration setting to true tells the class to use the internal implementation instead of using the system security libraries.

On Windows, this setting is set to false by default. On Linux/macOS, this setting is set to true by default.

To use the system security libraries for Linux, OpenSSL support must be enabled. For more information on how to enable OpenSSL, please refer to the OpenSSL Notes section.

Trappable Errors (OfficeDoc Class)

Error Handling (C++)

Call the GetLastErrorCode() method to obtain the last called method's result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. Known error codes are listed below. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.

Errors

The following errors may be generated by the class. Note that frequently the error message will contain more specific information than what is listed here.

Note that some non-fatal errors may be trapped and explicitly ignored in the Error event. This will allow the class to continue operation even in case of error.

OfficeDoc Errors

268   The specified part name could not be found on the package, or the part is stored in interleaved format.