Greetings all,
I'm working on a macro in VBA. During the macro, I have a message pop-up requesting the user to select an item that needs to be updated. What code could I use that would pause the macro (and not a timer) and then resume after the usre selects a single item?
I've used the code below to pause other macros which required user input for coordinates, however this code won't allow a selection process. Any thoughts?
CODE:
Dim doc As Document, retval1 As LongDim x1 As Double, y1 As Double, shift1 As LongSet doc = ActiveDocumentdoc.Unit = cdrMillimeterretval1 = doc.GetUserClick(x1, y1, shift1, 10, True, cdrCursorPick)
Dim x As Double, y As Double Dim Shift As Long Dim b As Boolean Dim s As Shape Dim cr As Long, cg As Long, cb As Long b = False While Not b // loop until b get true b = ActiveDocument.GetUserClick(x, y, Shift, 10, False, cdrCursorEyeDrop) If Not b Then Set s = ActiveLayer.CreateEllipse(x - 0.1, y - 0.1, x + 0.1, y + 0.1) cr = 0 cg = 0 cb = 0 If (Shift And 1) <> 0 Then cr = 255 ' Shift depressed - Add Red If (Shift And 2) <> 0 Then cg = 255 ' Ctrl depressed - Add Green If (Shift And 4) <> 0 Then cb = 255 ' Alt depressed - Add Blue s.Fill.UniformColor.RGBAssign cr, cg, cb End If Wend End Sub
I'm not understanding how this resolves my problem. The code you posted creates a shape. I need code that allows the user to select a shape that already exists on the active layer.