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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening an email - but not sending 1

Status
Not open for further replies.

tedzap

Programmer
Aug 12, 2006
31
US
I would like to attach a capture file to an email and send it using Outlook. I got this to work in fully automatic mode using some of the sample scripts from "aspectscripting.com". (thanks!)

I would actually like *more* humin interaction with this. Is there a way to have the script open up a new email message, fill in some of the fields but not send it? I would like the user to have the opportunity to add a blurb (or change his recipient) before sending it.

It seems like I ran across an example of this, but cannot find it at this time.


 
Was this using one of the mapisend examples? If so, I don't believe there is a way to pause it (i.e. Outlook sends the email when Procomm is done sending the MAPI command). I have some code from a different project that manually drove the Outlook dialog (read an email, exported, grabbed a string, looked up in inventory system, and replied with pricing information) that may be more what you are looking for.

 
Yes, I am using one of the mapisend examples. I thought that I had run across an example that opened up a new email, but did not send it.

I would be interested in seeing how you went about doing the other code you mention... If it is on the aspectscripting.com site I must have skimmed over it. Is it available somewhere for public consumption?

thanks

 
Did a quick search of the site and found this one which shows how to find Outlook in the task list, bring it to the foregound, and open the new message window:


Will try to make the other script I mentioned workable but I'm currently getting over something my older son gave to me so it may be a little while.

 
outlook.was" is the one I had seen and was thinking of, thanks. I will be very interested in the script when you get around to it!
 
Knob, any progress with the other script you mention?
 
OK, give the below link a try:


I haven't had a chance to test it after gutting out some of the non-Outlook code, but I think it should work. The comments should help you follow along, but here's the basic gist. Procomm brings the Outlook window to the foreground (note, you may need to check your Outlook titlebar and modify the winactivate commands to match). It opens the selected message in the inbox, saves it as a text file, reads that text file, and then you could perform some operations based on the contents. In my case, I was pulling out an inventory number.

The script then closes the email, did its inventory processing where you see the Do other things comment, then uses winactivate when done with that to switch back to Outlook. The message is replied to, a text file is attached to the email (this contained the pricing information on the inventory part I belive from a template), queues the message for sending, then moves the original message to a folder for archival purposes. If the part was not in the inventory system, the next message was selected instead.

It looks like I may have taken out a bit too much with my edit as I think it will only go through one message and not all messages in the inbox, so will need to fix that a bit later (leaving work now).

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top