I would like to send email automatically via a command button. I have
accomplished this just fine through the following code: (Outlook
should already be open for reliable results)
Private Sub Command6_Click()
ReturnValue = Shell("Outlook.EXE", 1) ' Run Outlook
SendKeys "%(F)", True
SendKeys "W", True
SendKeys "M", True 'Open New Message
SendKeys "ra*********@harbornet.com", True '<-- Email Address
SendKeys "{TAB 2}", True
SendKeys "TestSubject", True '<-- Subject Line
SendKeys "{TAB}", True
SendKeys "Test Message", True '<-- Message Text
SendKeys "%(s)", True 'Send Message
End Sub
I have gone a little overkill with the sendkeys command (VB newbie).
Can any of you guru's step into my code so that it will place the
value of a text box rather than the values I have submited via
sendkeys for the email address, subjectline, and message text.
Your help is greatly appreciated.
Regards,
Jeremy 6 11912
Mr. Bungle wrote: I would like to send email automatically via a command button. I have accomplished this just fine through the following code: (Outlook should already be open for reliable results)
Private Sub Command6_Click() ReturnValue = Shell("Outlook.EXE", 1) ' Run Outlook SendKeys "%(F)", True SendKeys "W", True SendKeys "M", True 'Open New Message SendKeys "ra*********@harbornet.com", True '<-- Email Address SendKeys "{TAB 2}", True SendKeys "TestSubject", True '<-- Subject Line SendKeys "{TAB}", True SendKeys "Test Message", True '<-- Message Text SendKeys "%(s)", True 'Send Message End Sub
I have gone a little overkill with the sendkeys command (VB newbie). Can any of you guru's step into my code so that it will place the value of a text box rather than the values I have submited via sendkeys for the email address, subjectline, and message text.
Your help is greatly appreciated.
Regards, Jeremy
Consider DoCmd.SendObject or
Application.FollowHyperLink "mailto:adress@domain?subject=wibble&body=text "
--
Error reading sig - A)bort R)etry I)nfluence with large hammer
Mr. Bungle wrote: I would like to send email automatically via a command button. I have accomplished this just fine through the following code: (Outlook should already be open for reliable results)
Private Sub Command6_Click() ReturnValue = Shell("Outlook.EXE", 1) ' Run Outlook SendKeys "%(F)", True SendKeys "W", True SendKeys "M", True 'Open New Message SendKeys "ra*********@harbornet.com", True '<-- Email Address SendKeys "{TAB 2}", True SendKeys "TestSubject", True '<-- Subject Line SendKeys "{TAB}", True SendKeys "Test Message", True '<-- Message Text SendKeys "%(s)", True 'Send Message End Sub
I have gone a little overkill with the sendkeys command (VB newbie). Can any of you guru's step into my code so that it will place the value of a text box rather than the values I have submited via sendkeys for the email address, subjectline, and message text.
Your help is greatly appreciated.
Regards, Jeremy
Consider DoCmd.SendObject or
Application.FollowHyperLink "mailto:adress@domain?subject=wibble&body=text "
--
Error reading sig - A)bort R)etry I)nfluence with large hammer
Trevor Best <nospam@localhost> wrote in message news:<40***********************@auth.uk.news.easyn et.net>... Mr. Bungle wrote:
I would like to send email automatically via a command button. I have accomplished this just fine through the following code: (Outlook should already be open for reliable results)
Private Sub Command6_Click() ReturnValue = Shell("Outlook.EXE", 1) ' Run Outlook SendKeys "%(F)", True SendKeys "W", True SendKeys "M", True 'Open New Message SendKeys "ra*********@harbornet.com", True '<-- Email Address SendKeys "{TAB 2}", True SendKeys "TestSubject", True '<-- Subject Line SendKeys "{TAB}", True SendKeys "Test Message", True '<-- Message Text SendKeys "%(s)", True 'Send Message End Sub
I have gone a little overkill with the sendkeys command (VB newbie). Can any of you guru's step into my code so that it will place the value of a text box rather than the values I have submited via sendkeys for the email address, subjectline, and message text.
Your help is greatly appreciated.
Regards, Jeremy Consider DoCmd.SendObject or Application.FollowHyperLink "mailto:adress@domain?subject=wibble&body=text "
2 questions about this...
Using the Application.FollowHyperlink can you bind the email address,
subject, and body to a control on your form?
The DoCmd.SendObject command works wonders at home where I developed
it, it automatically sends email exactly how I want it. However, to my
demise,at work the function does absolutly nothing. We use an exchange
server at work (which is where I want to use this). Might this
(exchange server) have something to do with why the DoCmd.SendObject
does not work?
The Application.FollowHyperlink alternative approach works fine at my
work, the only problem as notated above is that I would like to bind
the email, subject, and body to a control on the form. Any
suggestions?
Regards,
Jeremy
Thanks,
Jeremy
Trevor Best <nospam@localhost> wrote in message news:<40***********************@auth.uk.news.easyn et.net>... Mr. Bungle wrote:
I would like to send email automatically via a command button. I have accomplished this just fine through the following code: (Outlook should already be open for reliable results)
Private Sub Command6_Click() ReturnValue = Shell("Outlook.EXE", 1) ' Run Outlook SendKeys "%(F)", True SendKeys "W", True SendKeys "M", True 'Open New Message SendKeys "ra*********@harbornet.com", True '<-- Email Address SendKeys "{TAB 2}", True SendKeys "TestSubject", True '<-- Subject Line SendKeys "{TAB}", True SendKeys "Test Message", True '<-- Message Text SendKeys "%(s)", True 'Send Message End Sub
I have gone a little overkill with the sendkeys command (VB newbie). Can any of you guru's step into my code so that it will place the value of a text box rather than the values I have submited via sendkeys for the email address, subjectline, and message text.
Your help is greatly appreciated.
Regards, Jeremy Consider DoCmd.SendObject or Application.FollowHyperLink "mailto:adress@domain?subject=wibble&body=text "
2 questions about this...
Using the Application.FollowHyperlink can you bind the email address,
subject, and body to a control on your form?
The DoCmd.SendObject command works wonders at home where I developed
it, it automatically sends email exactly how I want it. However, to my
demise,at work the function does absolutly nothing. We use an exchange
server at work (which is where I want to use this). Might this
(exchange server) have something to do with why the DoCmd.SendObject
does not work?
The Application.FollowHyperlink alternative approach works fine at my
work, the only problem as notated above is that I would like to bind
the email, subject, and body to a control on the form. Any
suggestions?
Regards,
Jeremy
Thanks,
Jeremy sl********@hotmail.com (Mr. Bungle) wrote: I would like to send email automatically via a command button.
See the Access Email FAQ at my website.
Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at http://www.granite.ab.ca/accsmstr.htm
Mr. Bungle wrote: Trevor Best <nospam@localhost> wrote in message news:<40***********************@auth.uk.news.easyn et.net>...
Consider DoCmd.SendObject or Application.FollowHyperLink "mailto:adress@domain?subject=wibble&body=text "
2 questions about this...
Using the Application.FollowHyperlink can you bind the email address, subject, and body to a control on your form?
The DoCmd.SendObject command works wonders at home where I developed it, it automatically sends email exactly how I want it. However, to my demise,at work the function does absolutly nothing. We use an exchange server at work (which is where I want to use this). Might this (exchange server) have something to do with why the DoCmd.SendObject does not work?
No, SendObject uss your mail client, it doesn't give a hoot what your
mail server software is.
The Application.FollowHyperlink alternative approach works fine at my work, the only problem as notated above is that I would like to bind the email, subject, and body to a control on the form. Any suggestions?
(assumed textbox names)
Application.FollowHyperLink "mailto:" & txtAddress & "?subject=" &
txtSubject & "&body=" & txtBody
--
Error reading sig - A)bort R)etry I)nfluence with large hammer This discussion thread is closed Replies have been disabled for this discussion. Similar topics
4 posts
views
Thread by Mr. Bungle |
last post: by
|
3 posts
views
Thread by StuartD |
last post: by
|
2 posts
views
Thread by RBohannon |
last post: by
|
1 post
views
Thread by George |
last post: by
|
reply
views
Thread by federico |
last post: by
|
reply
views
Thread by pigge79 |
last post: by
|
reply
views
Thread by Mac via DotNetMonster.com |
last post: by
| | | | | | | | | | | | |