• How to pause macro until user clicks mouse and releases? (VBA included)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » How to pause macro until user clicks mouse and releases? (VBA included)

    Author
    Topic
    #485218

    Word 2002 – the macro inserts a signature.bmp file into section 2 of a letter. Not a problem except section 1 is protected and section 2 is not. Once the graphic is inserted in section 2, it can’t be selected to move elsewhere, even though that section is unlocked for text input.

    What code would you add to pause the macro, unlock the form, insert the signature.bmp file, and let the user click and drag to the desired place. When mouse button is released, form would relock. My comments are in green.

    Thanks,
    Charlie
    charlie6067

    Sub InsertMySig()

    ’ Pause macro here, unlock form with password and insert the .bmp file into the letter. The .bmp file should be in
    ‘ a selected state for moving elsewhere.

    With ActiveDocument.Shapes.AddPicture(Anchor:=Selection.Range, FileName:= _
    “H:E-Signature-DO NOT DELETESignature.bmp”, LinkToFile:=False, _
    SaveWithDocument:=True)
    .WrapFormat.Type = 3
    .ZOrder 5

    End With

    ’ Wait until user clicks and moves the graphic to the desired location.
    ‘ When user releases mouse button, relock form with password

    End Sub

    Viewing 0 reply threads
    Author
    Replies
    • #1348818

      Not sure if that’s possible. What worked for me was to insert the whole signature line via an autotext. I’d set up the “yours sincerely”, bitmap, printed name, and other formalities on the page and create an autotext out of them under the person’s name.

    Viewing 0 reply threads
    Reply To: How to pause macro until user clicks mouse and releases? (VBA included)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: