Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Word email user form

Status
Not open for further replies.

dprayner

Programmer
Oct 14, 2002
140
US
Hi people.

As you know I have been working on emailing a screenshot of a UserForm. I have successfully created the UserForm, coded the features to copy the form image to the clipboard, paste it into the body of a Word document, set the emailing parameters (To, Cc, Subject, etc.), but I was having trouble submitting the document to a Mail Recipient. I actually was able to submit the dicument with the image of the form in the body of the email, but I encountered a message box and an error on the .Send line.

I decided to simulate the "keystokes" with SendKeys instead of using .Send.

The problem is something with my message boxes are preventing the SendKeys from working although the SendKeys are not contained in the decision structure (If vbOk Then). It will work if I comment out the MsgBoxes, or if I put the SendKeys in the Form_Terminate() Sub.

I am puzzled. Anyone have some insight? DAVE
 
Do a google search for outlook object model guard

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top