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
-
Hi Stanley,
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.
Yuri0 -
Hi YuriG:
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.
0 -
2022-02-14-142959StanleyH --I think you may be asking for a piece of sample CODE to illustrate how to use the INTERACTIVE MODE.Here is some CODE from one of my projects that may help you.Let me know if this is helpful.-- Matt-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*'DELETE ANY MEASUREMENT OBJECTS WHICH MAY BE ON THE IMAGE
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
0 -
Thanks Matt for your answer. Your answers in other posts also provided new comer many solutions.0
-
2022-02-15-092714StanleyH --I am glad to help.Lot's of folks have given me assistance over the years and I am glad to do that courtesy for others.Have a great day.-- Matt
0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions