Hello together,
I create a Userparamter:
Public Sub CreateTextUserParameter()
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oUserParameters As UserParameters
Set oUserParameters = oDoc.ComponentDefinition.Parameters.UserParameters
Dim oTextParam As UserParameter
Set oTextParam = oUserParameters.AddByValue("Printer_Name", "3DPrinter", kTextUnits)
End Sub
This does not work:
Dim oParam As Parameter
For Each oParam In doc.ComponentDefinition.Parameters
If oParam.Name = "Printer_Name" Then
If oParam.Expression = "3DPrinter" Then
MsgBox(oParam.Expression)
End If
End If
Next
But how could I check if the value exists and get the textvalue?
Thank you Georg
Solved! Go to Solution.
Hi,
Kindly find the code below which works
Dim oParam As Parameter
doc = ThisApplication.ActiveDocument
For Each oParam In doc.ComponentDefinition.Parameters
MsgBox(oParam.Name +" -- " +oParam.Expression)
If oParam.Name = "Printer_Name" Then
If oParam.Expression = """3DPrinter""" Then
MsgBox(oParam.Expression)
End If
End If
Next