Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
JelteDeJong
in reply to: nj21997

the property "invApp.ActiveDocument" will always return a object of the type "Document". the "Document" type does not have a property "ComponentDefinition". The type "PartDocument" has this property. Therefore you need to tell the compilere that it is save to treat the "invApp.ActiveDocument"as a "PartDocument". In VB.net you would do it like this:

Dim oPartDoc As PartDocument = invApp.ActiveDocument

 or in C# (which is a bit more strict)

PartDocument oPartDoc = (PartDocument)invApp.ActiveDocument

But I dont know how you would cast in Python.

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com