#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 209
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 209
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Email

try

Call Send_Msg()

or

run Send_Msg()

Good luck

Ken
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 209
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 210
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Macro how to create email link for the email addresses in aRange or Selection Satish[_2_] Excel Worksheet Functions 8 December 28th 09 03:30 PM
send wkbk as an email attachment with an email address copied from SueInAtl Excel Discussion (Misc queries) 0 May 21st 07 10:53 PM
can I copy a column of email addresses, paste into email address? Lizizfree New Users to Excel 4 July 20th 06 10:03 PM
Transfer Email addresses from spreadsheet to email address book Beana Excel Discussion (Misc queries) 2 May 30th 06 06:07 PM
Email editor closes when forwarding Excel-embedded email Bambina Setting up and Configuration of Excel 0 March 16th 06 10:45 PM


All times are GMT +1. The time now is 07:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"