- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am a new in inventor API : Now, I have a question to ask . thanks for lots first
I use one code downloaded form this forum to learn . as following
when the code run to oTitleBlock.SetPromptResultText (oTextBox,"HELLO WORLD!!!") a error happens
showing"Conpile error: syntax error"
I downloaded orthers code with the funtion SetPromptResultText() ,a same question happens
My inventor ver. is < inventor professional 2015>, Could any specilist tell me? WHY?
Sub title()
Dim oSheet As Sheet
Dim oTitleBlock As TitleBlock
Dim oTextBox As TextBox
Dim oTextBoxes As TextBoxes
Set oSheet = ThisApplication.ActiveDocument.ActiveSheet
If oSheet.TitleBlock Is Nothing Then Exit Sub
Set oTitleBlock = oSheet.TitleBlock
If oTitleBlock.Definition.Sketch.TextBoxes Is Nothing Then Exit Sub
Set oTextBoxes = oTitleBlock.Definition.Sketch.TextBoxes
For Each oTextBox In oTextBoxes
If oTextBox.Text = "MYPROMPTEDTEXT" Then Exit For
If oTextBox Is Nothing Or oTextBox.Text <> "MYPROMPTEDTEXT" Then
oTitleBlock.SetPromptResultText (oTextBox,"HELLO WORLD!!!")
End If
End If
Next
End Sub
Solved! Go to Solution.