Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    May 2009
    Thanked 0 Times in 0 Posts

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

    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.


    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 DELETE\Signature.bmp", LinkToFile:=False, _
    .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

  2. #2
    3 Star Lounger
    Join Date
    Apr 2012
    Milton, Ontario
    Thanked 25 Times in 25 Posts
    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts