Quantcast
Channel: NetOffice - MS Office in .NET
Viewing all articles
Browse latest Browse all 1741

Commented Unassigned: How to return a COMObject In a Collection? [21075]

$
0
0
internal static bool TryGetCustumXMLPart(this Document doc, string namespaceURI, out CustomXMLPart checkedPart) {
checkedPart = null;
using (CustomXMLParts parts = doc.CustomXMLParts) {
foreach (CustomXMLPart part in doc.CustomXMLParts) {
string partNamespaceURI = part.NamespaceURI;
if (partNamespaceURI == namespaceURI) {
checkedPart = new CustomXMLPart(part); << ERROR
return true;
}
}
}
return false;
}
Comments: ** Comment from web user: panewman **

Did you try

```
part.ParentObject.RemoveChildObject(part);
```


Viewing all articles
Browse latest Browse all 1741

Trending Articles