IOpcRelationship::GetId method (msopc.h)
Gets the unique identifier of the relationship.
Syntax
HRESULT GetId(
[out, retval] LPWSTR *relationshipIdentifier
);
Parameters
[out, retval] relationshipIdentifier
The identifier of the relationship.
The identifier of a relationship is arbitrary and local to the package, and, therefore, .
Valid identifiers conform to the restrictions for xsd:ID, which are documented in section 3.3.8 ID of the W3C Recommendation, XML Schema Part 2: Datatypes Second Edition (http://www.w3.org/TR/xmlschema-2/#ID).
Return value
The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Return code | Description |
---|---|
|
The method succeeded. |
|
The relationshipIdentifier parameter is NULL. |
Remarks
The identifier of a relationship is not useful for finding relationships because it is arbitrary and local to the package.
The definitive way to find a part of interest is by using a relationship type.
Finding a part requires several steps. For detailed information about finding a part, see Finding the Core Properties Part.
This method allocates memory used by the string returned in relationshipIdentifier. If the method succeeds, call the CoTaskMemFree function to free the memory.
For more information about relationships, see the Open Packaging Conventions Fundamentals and the ECMA-376 OpenXML, 1st Edition, Part 2: Open Packaging Conventions (OPC).
Thread Safety
Packaging objects are not thread-safe.
For more information, see the Getting Started with the Packaging API.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 7 [desktop apps only] |
Minimum supported server | Windows Server 2008 R2 [desktop apps only] |
Target Platform | Windows |
Header | msopc.h |
See also
External Resources
Finding the Core Properties Part
Getting Started with the Packaging API
Open Packaging Conventions Fundamentals
Overviews
Reference
W3C Recommendation, XML Schema Part 2: Datatypes Second Edition