How to get the Company property in VBA

How to get the Company property in VBA

LSA-skan
Advocate Advocate
425 Views
3 Replies
Message 1 of 4

How to get the Company property in VBA

LSA-skan
Advocate
Advocate

Hi

 

Im working on a code, where i would like the Company property displayed in a Form for editing. I can do it with the Project property, and several others, but the Company property seem to be named something else.

 

I have tried with numbers as well, but no numbers seem to be the correct property.

 

This is the code i have.

 

Public Sub SorterDXF()

Dim invDoc As Document
Set invDoc = ThisApplication.ActiveDocument

Dim invDesignInfo As PropertySet
Set invDesignInfo = invDoc.PropertySets.Item("Design Tracking Properties")

Dim invPartNumberProperty As Property
Set invPartNumberProperty = invDesignInfo.Item("Project")

Project = invPartNumberProperty.Value

SortForm.FormOrdre.Value = Project

 

Dim invSummaryInfo As PropertySet
Set invSummaryInfo = invDoc.PropertySets.Item("Inventor Summary Information")

Dim invSummaryInfoProperty As Property
Set invSummaryInfoProperty = invSummaryInfo.Item(???????)

Kunde = invSummaryInfoProperty.Value

SortForm.FormKunde.Value = Kunde

SortForm.Show

End Sub

0 Likes
Accepted solutions (2)
426 Views
3 Replies
Replies (3)
Message 2 of 4

WCrihfield
Mentor
Mentor
Accepted solution

Hi @LSA-skan.  The standard iProperty named "Company" is within the PropertySet named "Inventor Document Summary Information" (the second PropertySet in the PropertySets collection), and is the 3rd item in its collection, with PropId = 15.  Its Enum value is "PropertiesForDocSummaryInformationEnum.kCompanyDocSummaryInformation".

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 4

A.Acheson
Mentor
Mentor
Accepted solution

Hi,

That is held in a different category of propertySets. See helpful article.

invDoc.PropertySets.Item("Inventor Document Summary Information")

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 4 of 4

LSA-skan
Advocate
Advocate

@WCrihfield @A.Acheson Thanks for your replies..! Now everything works as it should.. 😄

0 Likes