Hello Community,
ist there a way to react in a VBA-Userform if an object is selectd in the document.
I want to read a few field from Objectdata and show these in a textbox.
Thanks in advance!
Yes there is a SelectionChange Event. You can find an example of how to use it in a docker here. Custom Dockers in CorelDRAW, Corel DESIGNER and Corel PHOTO-PAINT
You will also see a list of other events:
If you want an example of how to do this with a UserForm you may watch the following video:Selection change event, update size in textbox in a custom macro in CorelDraw, tutorial.
Hope that helps,
-Shelby
Thank you Shelby,
That is to heavy for me...Is it possible that you post a little vba code which will do that?Thanks in advance!
Hello,An interesting task. Thank you!Now I will explain how to read ActiveShape.Name of UserForm.tbName and how to change ActiveShape.Name by entering new name in UserForm.tbName1. Create User Form with name uf_BhBp_Duplicate_X5. Set property Modal = False2. Create Text Box on it with Name tbObjectName3. Private Sub tbObjectName_Change()If ActiveSelection.Shapes.Count > 0 ThenActiveShape.Name = tbObjectName.ValueEnd IfEnd Sub4. Private Sub UserForm_Activate()If ActiveSelection.Shapes.Count = 1 Then 'if any shape is selectedtbObjectName.Value = ActiveShape.NameEnd If...End Sub5.Private Sub GlobalMacroStorage_SelectionChange()If uf_BhBp_Duplicate_X5.Visible ThenIf ActiveSelection.Shapes.Count > 0 Thenuf_BhBp_Duplicate_X5.tbObjectName.Value = ActiveShape.NameEnd IfEnd IfEnd SubReady!If more question, please ask here!If you want to support me, please use PayPalThank You!Greetings!