Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Email
I bave read some off the Questions in this forum about Excel and email
but all off them is about a error and so on. CAn some one tell be from the start please, iahve a user form with some values can i ( and how) make a commandbuttom there send this values to outlook and start outlook, the values are email adress, and some information Best regards alvin |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Email
Alvin
The following is code I use to automatically send an outlook message, with values taken from a spreadsheet. The macro is assigned to a command button on the worksheet. Sub Send_Msg() Dim objOL As New Outlook.Application Dim objMail As MailItem Set objOL = New Outlook.Application Set objMail = objOL.CreateItem(olMailItem) msg = "Dianne," & Chr(13) & Chr(13) msg = msg & "The attached excel file shows a new job that needs to be setup." & Chr(13) msg = msg & "Please inform Bruce of the job number." & Chr(13) & Chr(13) msg = msg & "Thanks. Ken" addee = range("a1").value CC = range("b1").value With objMail .To = addee .CC = CC .Subject = "New job" .Body = msg .Display .Send End With Set objMail = Nothing Set objOL = Nothing MsgBox "File has been e-mailed to " & addee End Sub Like a lot of the stuff I use, this is patterned after something I learned in this newsgroup. I hope this helps. Ken |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Email
Thank you very much
Its working but i get an error when i will assigned to a command button i have this Private Sub CommandButton1_Click() Send_Msg() End Sub HEre i get an error what do i do wrong Regards alvin "KRCowen" skrev: Alvin The following is code I use to automatically send an outlook message, with values taken from a spreadsheet. The macro is assigned to a command button on the worksheet. Sub Send_Msg() Dim objOL As New Outlook.Application Dim objMail As MailItem Set objOL = New Outlook.Application Set objMail = objOL.CreateItem(olMailItem) msg = "Dianne," & Chr(13) & Chr(13) msg = msg & "The attached excel file shows a new job that needs to be setup." & Chr(13) msg = msg & "Please inform Bruce of the job number." & Chr(13) & Chr(13) msg = msg & "Thanks. Ken" addee = range("a1").value CC = range("b1").value With objMail .To = addee .CC = CC .Subject = "New job" .Body = msg .Display .Send End With Set objMail = Nothing Set objOL = Nothing MsgBox "File has been e-mailed to " & addee End Sub Like a lot of the stuff I use, this is patterned after something I learned in this newsgroup. I hope this helps. Ken |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Email
try
Call Send_Msg() or run Send_Msg() Good luck Ken |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Email
Maybe you need to add a reference to Outlook.
Inside the VBE with your project selected, tools|references|search for MS Outlook (I don't recall the full name) and select it. If you'll share the workbook/macro with others and they run different versions of Outlook, you may want to remove the reference and use late binding. Dick Kusleika has a web page at: http://www.dicks-clicks.com/excel/olBinding.htm that explains this with Outlook Alvin Hansen wrote: Thank you very much Its working but i get an error when i will assigned to a command button i have this Private Sub CommandButton1_Click() Send_Msg() End Sub HEre i get an error what do i do wrong Regards alvin "KRCowen" skrev: Alvin The following is code I use to automatically send an outlook message, with values taken from a spreadsheet. The macro is assigned to a command button on the worksheet. Sub Send_Msg() Dim objOL As New Outlook.Application Dim objMail As MailItem Set objOL = New Outlook.Application Set objMail = objOL.CreateItem(olMailItem) msg = "Dianne," & Chr(13) & Chr(13) msg = msg & "The attached excel file shows a new job that needs to be setup." & Chr(13) msg = msg & "Please inform Bruce of the job number." & Chr(13) & Chr(13) msg = msg & "Thanks. Ken" addee = range("a1").value CC = range("b1").value With objMail .To = addee .CC = CC .Subject = "New job" .Body = msg .Display .Send End With Set objMail = Nothing Set objOL = Nothing MsgBox "File has been e-mailed to " & addee End Sub Like a lot of the stuff I use, this is patterned after something I learned in this newsgroup. I hope this helps. Ken -- Dave Peterson |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Email
(I don't recall the full name)
1) Go to the VBA editor, Alt -F11 2) ToolsReferences in the Menu bar 3) Place a Checkmark before Microsoft Outlook ? Object Library ? is the Excel version number -- Regards Ron de Bruin http://www.rondebruin.nl "Dave Peterson" wrote in message ... Maybe you need to add a reference to Outlook. Inside the VBE with your project selected, tools|references|search for MS Outlook (I don't recall the full name) and select it. If you'll share the workbook/macro with others and they run different versions of Outlook, you may want to remove the reference and use late binding. Dick Kusleika has a web page at: http://www.dicks-clicks.com/excel/olBinding.htm that explains this with Outlook Alvin Hansen wrote: Thank you very much Its working but i get an error when i will assigned to a command button i have this Private Sub CommandButton1_Click() Send_Msg() End Sub HEre i get an error what do i do wrong Regards alvin "KRCowen" skrev: Alvin The following is code I use to automatically send an outlook message, with values taken from a spreadsheet. The macro is assigned to a command button on the worksheet. Sub Send_Msg() Dim objOL As New Outlook.Application Dim objMail As MailItem Set objOL = New Outlook.Application Set objMail = objOL.CreateItem(olMailItem) msg = "Dianne," & Chr(13) & Chr(13) msg = msg & "The attached excel file shows a new job that needs to be setup." & Chr(13) msg = msg & "Please inform Bruce of the job number." & Chr(13) & Chr(13) msg = msg & "Thanks. Ken" addee = range("a1").value CC = range("b1").value With objMail .To = addee .CC = CC .Subject = "New job" .Body = msg .Display .Send End With Set objMail = Nothing Set objOL = Nothing MsgBox "File has been e-mailed to " & addee End Sub Like a lot of the stuff I use, this is patterned after something I learned in this newsgroup. I hope this helps. Ken -- Dave Peterson |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Email
Thanks, Ron.
(I bet I could have looked at your site, huh? But I do think that late binding is safer (and will require fewer updates later).) Ron de Bruin wrote: (I don't recall the full name) 1) Go to the VBA editor, Alt -F11 2) ToolsReferences in the Menu bar 3) Place a Checkmark before Microsoft Outlook ? Object Library ? is the Excel version number -- Regards Ron de Bruin http://www.rondebruin.nl "Dave Peterson" wrote in message ... Maybe you need to add a reference to Outlook. Inside the VBE with your project selected, tools|references|search for MS Outlook (I don't recall the full name) and select it. If you'll share the workbook/macro with others and they run different versions of Outlook, you may want to remove the reference and use late binding. Dick Kusleika has a web page at: http://www.dicks-clicks.com/excel/olBinding.htm that explains this with Outlook Alvin Hansen wrote: Thank you very much Its working but i get an error when i will assigned to a command button i have this Private Sub CommandButton1_Click() Send_Msg() End Sub HEre i get an error what do i do wrong Regards alvin "KRCowen" skrev: Alvin The following is code I use to automatically send an outlook message, with values taken from a spreadsheet. The macro is assigned to a command button on the worksheet. Sub Send_Msg() Dim objOL As New Outlook.Application Dim objMail As MailItem Set objOL = New Outlook.Application Set objMail = objOL.CreateItem(olMailItem) msg = "Dianne," & Chr(13) & Chr(13) msg = msg & "The attached excel file shows a new job that needs to be setup." & Chr(13) msg = msg & "Please inform Bruce of the job number." & Chr(13) & Chr(13) msg = msg & "Thanks. Ken" addee = range("a1").value CC = range("b1").value With objMail .To = addee .CC = CC .Subject = "New job" .Body = msg .Display .Send End With Set objMail = Nothing Set objOL = Nothing MsgBox "File has been e-mailed to " & addee End Sub Like a lot of the stuff I use, this is patterned after something I learned in this newsgroup. I hope this helps. Ken -- Dave Peterson -- Dave Peterson |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Email
Hi Dave
(I bet I could have looked at your site, huh? But I do think that late binding is safer (and will require fewer updates later).) I agree, but 1) You miss this : Intellisense showing you the properties and methods 2) and Early binding is a bit faster I have a Late binding example below all my Outlook examples on my site (and a link to Dick's site) -- Regards Ron de Bruin http://www.rondebruin.nl "Dave Peterson" wrote in message ... Thanks, Ron. (I bet I could have looked at your site, huh? But I do think that late binding is safer (and will require fewer updates later).) Ron de Bruin wrote: (I don't recall the full name) 1) Go to the VBA editor, Alt -F11 2) ToolsReferences in the Menu bar 3) Place a Checkmark before Microsoft Outlook ? Object Library ? is the Excel version number -- Regards Ron de Bruin http://www.rondebruin.nl "Dave Peterson" wrote in message ... Maybe you need to add a reference to Outlook. Inside the VBE with your project selected, tools|references|search for MS Outlook (I don't recall the full name) and select it. If you'll share the workbook/macro with others and they run different versions of Outlook, you may want to remove the reference and use late binding. Dick Kusleika has a web page at: http://www.dicks-clicks.com/excel/olBinding.htm that explains this with Outlook Alvin Hansen wrote: Thank you very much Its working but i get an error when i will assigned to a command button i have this Private Sub CommandButton1_Click() Send_Msg() End Sub HEre i get an error what do i do wrong Regards alvin "KRCowen" skrev: Alvin The following is code I use to automatically send an outlook message, with values taken from a spreadsheet. The macro is assigned to a command button on the worksheet. Sub Send_Msg() Dim objOL As New Outlook.Application Dim objMail As MailItem Set objOL = New Outlook.Application Set objMail = objOL.CreateItem(olMailItem) msg = "Dianne," & Chr(13) & Chr(13) msg = msg & "The attached excel file shows a new job that needs to be setup." & Chr(13) msg = msg & "Please inform Bruce of the job number." & Chr(13) & Chr(13) msg = msg & "Thanks. Ken" addee = range("a1").value CC = range("b1").value With objMail .To = addee .CC = CC .Subject = "New job" .Body = msg .Display .Send End With Set objMail = Nothing Set objOL = Nothing MsgBox "File has been e-mailed to " & addee End Sub Like a lot of the stuff I use, this is patterned after something I learned in this newsgroup. I hope this helps. Ken -- Dave Peterson -- Dave Peterson |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Email
Thanks now its working
whit call many thanks Regards alvin "KRCowen" skrev: try Call Send_Msg() or run Send_Msg() Good luck Ken |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
Email
I try to develop using the reference. But when I release it to others, I'll
change it late binding. Ron de Bruin wrote: Hi Dave (I bet I could have looked at your site, huh? But I do think that late binding is safer (and will require fewer updates later).) I agree, but 1) You miss this : Intellisense showing you the properties and methods 2) and Early binding is a bit faster I have a Late binding example below all my Outlook examples on my site (and a link to Dick's site) -- Regards Ron de Bruin http://www.rondebruin.nl "Dave Peterson" wrote in message ... Thanks, Ron. (I bet I could have looked at your site, huh? But I do think that late binding is safer (and will require fewer updates later).) Ron de Bruin wrote: (I don't recall the full name) 1) Go to the VBA editor, Alt -F11 2) ToolsReferences in the Menu bar 3) Place a Checkmark before Microsoft Outlook ? Object Library ? is the Excel version number -- Regards Ron de Bruin http://www.rondebruin.nl "Dave Peterson" wrote in message ... Maybe you need to add a reference to Outlook. Inside the VBE with your project selected, tools|references|search for MS Outlook (I don't recall the full name) and select it. If you'll share the workbook/macro with others and they run different versions of Outlook, you may want to remove the reference and use late binding. Dick Kusleika has a web page at: http://www.dicks-clicks.com/excel/olBinding.htm that explains this with Outlook Alvin Hansen wrote: Thank you very much Its working but i get an error when i will assigned to a command button i have this Private Sub CommandButton1_Click() Send_Msg() End Sub HEre i get an error what do i do wrong Regards alvin "KRCowen" skrev: Alvin The following is code I use to automatically send an outlook message, with values taken from a spreadsheet. The macro is assigned to a command button on the worksheet. Sub Send_Msg() Dim objOL As New Outlook.Application Dim objMail As MailItem Set objOL = New Outlook.Application Set objMail = objOL.CreateItem(olMailItem) msg = "Dianne," & Chr(13) & Chr(13) msg = msg & "The attached excel file shows a new job that needs to be setup." & Chr(13) msg = msg & "Please inform Bruce of the job number." & Chr(13) & Chr(13) msg = msg & "Thanks. Ken" addee = range("a1").value CC = range("b1").value With objMail .To = addee .CC = CC .Subject = "New job" .Body = msg .Display .Send End With Set objMail = Nothing Set objOL = Nothing MsgBox "File has been e-mailed to " & addee End Sub Like a lot of the stuff I use, this is patterned after something I learned in this newsgroup. I hope this helps. Ken -- Dave Peterson -- Dave Peterson -- Dave Peterson |
#11
Posted to microsoft.public.excel.programming
|
|||
|
|||
Email
Users are sure to find in 'view dbx file' (http://www.oemailrecovery.com/view-dbx-files.html) and 'outlook express troubleshooting' (http://www.mail-repair.com/troublesh...k-express.html) tool, simple yet versatile, to solve potential problems and stay in control of damaged dbx files in the safe folder. -- outlook_12345 ------------------------------------------------------------------------ outlook_12345's Profile: http://www.excelforum.com/member.php...o&userid=29022 View this thread: http://www.excelforum.com/showthread...hreadid=263460 |
#12
Posted to microsoft.public.excel.programming
|
|||
|
|||
Email
Hey Guys,
I stumbled onto this issue as well, but I am so new at this that I have no clue where to insert the email address of the person that I want to send it to. Any help would be greatly appreciated. "Alvin Hansen" wrote: Thanks now its working whit call many thanks Regards alvin "KRCowen" skrev: try Call Send_Msg() or run Send_Msg() Good luck Ken |
#13
Posted to microsoft.public.excel.programming
|
|||
|
|||
Email
I can not send e mail to my instructor at school when I have used microsoft
to write my paper. Can someone help me? This is the message I getA time-out occurred while communicating with the server. Account: 'HTTP', Server: 'aol.com', Protocol: SMTP, Port: 25, Secure(SSL): No, Error Number: 0x800CCC19 Please help me? Thanks Robin "Dave Peterson" wrote: Thanks, Ron. (I bet I could have looked at your site, huh? But I do think that late binding is safer (and will require fewer updates later).) Ron de Bruin wrote: (I don't recall the full name) 1) Go to the VBA editor, Alt -F11 2) ToolsReferences in the Menu bar 3) Place a Checkmark before Microsoft Outlook ? Object Library ? is the Excel version number -- Regards Ron de Bruin http://www.rondebruin.nl "Dave Peterson" wrote in message ... Maybe you need to add a reference to Outlook. Inside the VBE with your project selected, tools|references|search for MS Outlook (I don't recall the full name) and select it. If you'll share the workbook/macro with others and they run different versions of Outlook, you may want to remove the reference and use late binding. Dick Kusleika has a web page at: http://www.dicks-clicks.com/excel/olBinding.htm that explains this with Outlook Alvin Hansen wrote: Thank you very much Its working but i get an error when i will assigned to a command button i have this Private Sub CommandButton1_Click() Send_Msg() End Sub HEre i get an error what do i do wrong Regards alvin "KRCowen" skrev: Alvin The following is code I use to automatically send an outlook message, with values taken from a spreadsheet. The macro is assigned to a command button on the worksheet. Sub Send_Msg() Dim objOL As New Outlook.Application Dim objMail As MailItem Set objOL = New Outlook.Application Set objMail = objOL.CreateItem(olMailItem) msg = "Dianne," & Chr(13) & Chr(13) msg = msg & "The attached excel file shows a new job that needs to be setup." & Chr(13) msg = msg & "Please inform Bruce of the job number." & Chr(13) & Chr(13) msg = msg & "Thanks. Ken" addee = range("a1").value CC = range("b1").value With objMail .To = addee .CC = CC .Subject = "New job" .Body = msg .Display .Send End With Set objMail = Nothing Set objOL = Nothing MsgBox "File has been e-mailed to " & addee End Sub Like a lot of the stuff I use, this is patterned after something I learned in this newsgroup. I hope this helps. Ken -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using Macro how to create email link for the email addresses in aRange or Selection | Excel Worksheet Functions | |||
send wkbk as an email attachment with an email address copied from | Excel Discussion (Misc queries) | |||
can I copy a column of email addresses, paste into email address? | New Users to Excel | |||
Transfer Email addresses from spreadsheet to email address book | Excel Discussion (Misc queries) | |||
Email editor closes when forwarding Excel-embedded email | Setting up and Configuration of Excel |