Results 1 to 2 of 2
2012-09-05, 16:35 #1
- 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.
' 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
' Wait until user clicks and moves the graphic to the desired location.
' When user releases mouse button, relock form with password
2012-09-12, 10:55 #2
- Join Date
- Apr 2012
- Thanked 24 Times in 24 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.