|
-
April 1st, 2001, 04:35 PM
#1
E-mail pop-up
In VB(A), I am looking to have an Outlook e-mail window (with to:, from:, subject:, and message body filled out) to pop up on an event in my program. How do I do this from within VBA (MS Access)?
Thanks for any and all help!
-Tom
-
April 1st, 2001, 07:55 PM
#2
Re: E-mail pop-up
I actually program a email notify program which will notify you in the event of new mail. It works on POP3 server. It use a library from
http://vblib.virtualave.net
if you need the program, please send me a private message to give an email address for me to send to.
-
April 1st, 2001, 07:55 PM
#3
Re: E-mail pop-up
The following should work in Access 97:
Dim olMail as Object
Dim olApp as Object
set olApp = CreateObject("Outlook.Application")
set olMail = olApp.CreateItem(0)
With olMail
.to = "Send to This Person"
.Subject = "This is the Subject"
.Body = "Hello" & vbCrLf & "This is my message"
.Display true
End With
olApp.Quit
Alternatively, if you include the Microsoft Outlook Object Model as a reference, the code would be as follows:
Dim olApp as new Outlook.Application
Dim olMail as Outlook.MailItem
set olMail = olApp.CreateItem(olMailItem)
With olMail
.to = "Send to This Person"
.Subject = "This is the Subject"
.Body = "Hello" & vbCrLf & "This is my message"
.Display true
End With
olApp.Quit
The True variable in the .Display line simply shows the mail item modally. If you omit this, then you will have to quit the olApp somewhere else as you can't quit the App without closing the e-mail.
Hope this helps,
Nathan Liebke
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|