- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
For my Purchased parts downloaded from the web I made an Add-in that changes the part to purchased and adds some custom Iprops, now that Im working with MS Access I want to add that part to a Parts list from the project from a button in the Add-in but Cant figuer out how to call a external rule to run frm the click of the button.
here is the code in the Default.ivb-COMPRAS (code)
Private Sub CommandButton1_Click()
Dim invDoc As Document
Set invDoc = ThisApplication.ActiveDocument
' Get the user defined (custom) property set.
Dim invCustomPropertySet As PropertySet
Set invCustomPropertySet = invDoc.PropertySets.Item("Inventor User Defined Properties")
' Declare some variables that will contain the various values.
Dim strProv As String
Dim STRTEL As String
Dim strEmail As String
Dim strTE As String
Dim strWBL As String
' Set values for the variables.
strProv = "Some sample text."
STRTEL = TextBox1.Value
strEmail = "Some sample text."
strTE = "Some sample text."
strWBL = "Some sample text."
' Create the properties.
Set invProperty = invCustomPropertySet.Add(strProv, "PROVEEDOR")
Set invProperty = invCustomPropertySet.Add(STRTEL, "TELEFONO")
Set invProperty = invCustomPropertySet.Add(strEmail, "E-MAIL")
Set invProperty = invCustomPropertySet.Add(strTE, "TIEMPO DE ENTREGA")
Set invProperty = invCustomPropertySet.Add(strWBL, "WEB")
End Sub
Private Sub CommandButton2_Click()
' Get the active document.
Dim doc As Document
Set doc = ThisApplication.ActiveDocument
' Get the custom property set.
Dim customPropSet As PropertySet
Set customPropSet = doc.PropertySets.Item( _
"Inventor User Defined Properties")
' Get the property named "TELEFONO".
Dim customProp1 As Property
Dim customProp2 As Property
Dim customProp3 As Property
Dim customProp4 As Property
Dim customProp5 As Property
Set customProp1 = customPropSet.Item("TELEFONO")
Set customProp2 = customPropSet.Item("PROVEEDOR")
Set customProp3 = customPropSet.Item("E-MAIL")
Set customProp4 = customPropSet.Item("TIEMPO DE ENTREGA")
Set customProp5 = customPropSet.Item("WEB")
' Set the value of the property.
customProp1.Value = TextBox1.Value
customProp2.Value = TextBox2.Value
customProp3.Value = TextBox3.Value
customProp4.Value = TextBox4.Value
customProp5.Value = TextBox5.Value
End Sub
Private Sub CommandButton3_Click()
' Get the active document.
Dim doc As Document
Set doc = ThisApplication.ActiveDocument
doc.ComponentDefinition.BOMStructure = 51973
End Sub
Private Sub database_Click()
End Sub
Solved! Go to Solution.