User Prompt interactive function
Hi Specialist:
I have read some excellent solutions about interactive prompt, but could someone give solution to the interactive function.
what is the event function to this "ok" button and "cancel" Thank you
I have read some excellent solutions about interactive prompt, but could someone give solution to the interactive function.
what is the event function to this "ok" button and "cancel" Thank you
Tagged:
0
Answers
When you click OK, the macro continues, when Cancel - it throws an error, so you can put the command in try/catch block and handle Cancel in the catch.
Yuri
Thanks for your prompt response. I am just interested in other method as I found the solution of try .. catch in the link: https://forums.mediacy.com/discussion/comment/969#Comment_969
But very appreciate for your help.
With Measure.MeasurementsCommands.DeleteAll(Nothing)
.Run(ThisApplication.Activedocument)
End With
'DELETE ANY ROI OBJECTS WHICH MAY BE ON THE IMAGE
With [Select].RoiCommands.DeleteAll(Nothing)
.Run(ThisApplication.Activedocument)
End With
'Use TRY and CATCH to handle errors
Dim My_Flag As String
Try
'SET THE CIRCLE TYPE TO CENTER RADIUS
With Measure.MeasurementsCommands.Options(Nothing)
.CircleCreationMethod = McMMOptions.mcmmccMethods.mcmmccCenterRadius
.Run(ThisApplication.Activedocument)
End With
With Measure.Measurements.ToolsCommands.Select(Nothing)
.prompt = _
"Please create a " & vbLf & vbLf & _
"CENTER RADIUS CIRCLES over BACKGROUND AREAS" & vbLf & vbLf & _
"then press OK to CONTINUE!"
.Tool = emmtool.Circle
.Interactive = True
.Run(Nothing)
End With
Catch
'ACTION FOR CANCEL PRESSED
Finally
End Try