473,574 Members | 5,894 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sending Email and the lovely SendKeys command.

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*********@ha rbornet.com", True '<-- Email Address
SendKeys "{TAB 2}", True
SendKeys "TestSubjec t", 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
Nov 12 '05 #1
6 12203
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*********@ha rbornet.com", True '<-- Email Address
SendKeys "{TAB 2}", True
SendKeys "TestSubjec t", 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.SendObjec t or
Application.Fol lowHyperLink "mailto:adress@ domain?subject= wibble&body=tex t"
--
Error reading sig - A)bort R)etry I)nfluence with large hammer
Nov 12 '05 #2
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*********@ha rbornet.com", True '<-- Email Address
SendKeys "{TAB 2}", True
SendKeys "TestSubjec t", 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.SendObjec t or
Application.Fol lowHyperLink "mailto:adress@ domain?subject= wibble&body=tex t"
--
Error reading sig - A)bort R)etry I)nfluence with large hammer
Nov 12 '05 #3
Trevor Best <nospam@localho st> wrote in message news:<40******* *************** *@auth.uk.news. easynet.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*********@ha rbornet.com", True '<-- Email Address
SendKeys "{TAB 2}", True
SendKeys "TestSubjec t", 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.SendObjec t or
Application.Fol lowHyperLink "mailto:adress@ domain?subject= wibble&body=tex t"


2 questions about this...

Using the Application.Fol lowHyperlink can you bind the email address,
subject, and body to a control on your form?

The DoCmd.SendObjec t 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.SendObjec t
does not work?

The Application.Fol lowHyperlink 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
Nov 12 '05 #4
Trevor Best <nospam@localho st> wrote in message news:<40******* *************** *@auth.uk.news. easynet.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*********@ha rbornet.com", True '<-- Email Address
SendKeys "{TAB 2}", True
SendKeys "TestSubjec t", 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.SendObjec t or
Application.Fol lowHyperLink "mailto:adress@ domain?subject= wibble&body=tex t"


2 questions about this...

Using the Application.Fol lowHyperlink can you bind the email address,
subject, and body to a control on your form?

The DoCmd.SendObjec t 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.SendObjec t
does not work?

The Application.Fol lowHyperlink 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
Nov 12 '05 #5
sl********@hotm ail.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
Nov 12 '05 #6
Mr. Bungle wrote:
Trevor Best <nospam@localho st> wrote in message news:<40******* *************** *@auth.uk.news. easynet.net>...
Consider DoCmd.SendObjec t or
Application.F ollowHyperLink "mailto:adress@ domain?subject= wibble&body=tex t"

2 questions about this...

Using the Application.Fol lowHyperlink can you bind the email address,
subject, and body to a control on your form?

The DoCmd.SendObjec t 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.SendObjec t
does not work?


No, SendObject uss your mail client, it doesn't give a hoot what your
mail server software is.
The Application.Fol lowHyperlink 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.Fol lowHyperLink "mailto:" & txtAddress & "?subject=" &
txtSubject & "&body=" & txtBody

--
Error reading sig - A)bort R)etry I)nfluence with large hammer
Nov 12 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1428
by: Mr. Bungle | last post by:
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 ...
3
4115
by: StuartD | last post by:
I have developed an Access database and wish to e-mail a form to a central address advising of changes etc. Have the form and command button the form with a macro behind using SendObject command. When I use the command button, the program opens Lotus Notes, inserts the correct e-mail address but does not attach the form. If I send the...
2
5689
by: RBohannon | last post by:
I need to create a report in MS Word populated with data from A2K. I have been asked to create the report in Word so that parts of it can be edited as necessary later. The data in the report are in a table with headings for each column, so converting an Access report to a Word doc in RTF doesn't work because only the text is converted, not...
1
9533
by: George | last post by:
Every time I used the Sendkeys command in my application the "Numlock" turned off and I couldn't use the keypad to hit numbers...... The old code was: Private Sub Command1_Click() SendKeys "{DOWN}" SendKeys "^{END}" SendKeys "{TAB}" End Sub
0
2020
by: federico | last post by:
Hello, how can I make a program respond to another program's input request? For example, this code: Process.Start("unrar.exe", "e D:\temp\key.rar D:temp2") SendKeys.SendWait("test~") will successfully start a program that prompts for a password, and then submit the password via SendKeys. SendKeys will work with both console and...
0
1671
by: pigge79 | last post by:
Hi there, I've developing an application that translates keystrokes sent from my TV card remote control to Windows XP Media Center, since the two are not compatible. I've successfully been able to use System.Windows.Forms.SendKeys.Send to send keypresses to Windows XP Media Center, except for the backspace character that I need when...
0
1671
by: Mac via DotNetMonster.com | last post by:
Hi all, I am attempting to send keystrokes to a telnet application I have opened from my DotNet application. But am having a issue. In my VB.Net app I firstly open the telnet app using the Shell command with the default "MinimisedFocus" behaviour. I then use the AppActivate command to ensure the telnet application is activated and then...
1
1681
by: Spin | last post by:
Hi, I am trying to setup a macro that emails out a spreadsheet when activated. When I activate the macro it stops to give me a decision block if I want to send out the email "Yes", "No" or "Cancel". I just want to have it autoamtically send out this email with the spreadsheet with no decsion block. I tried to use a Sendkeys macro command with...
0
4826
by: Graycon | last post by:
I am trying to reboot several devices on my private network through telnet. I wrote a vbs that does the operation but i cannot select any other window while it is running of the input will not go into the telnet window created. I have begun to convert the code to C++ and am having problems I can get telnet to open to the ip address that I want...
0
7826
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7741
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8085
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7838
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8126
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6491
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5328
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2257
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1090
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.