A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Send emails through outlook 2007



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 21st 07, 06:40 PM posted to microsoft.public.outlook.program_vba
david f[_2_]
external usenet poster
 
Posts: 7
Default Send emails through outlook 2007

I have a word doc that can generate emails and send out them through outlook.
it works fine when I use outlook 2003(I chose yes when the outlook security
asked me if I want to send mail).
but after I upgrade to office 2007, even after I select "allow" on security
warning, I check sent folder, there is no email sent out. and the receiver
does not receive emails.

What should I do to let macros in a word doc sending emails through outlook
2007?

Thanks a lot! have a great day!
  #2  
Old August 21st 07, 07:40 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Send emails through outlook 2007

Do you have any error handling in your code? Can you step through it without
error?

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"david f" wrote:

I have a word doc that can generate emails and send out them through outlook.
it works fine when I use outlook 2003(I chose yes when the outlook security
asked me if I want to send mail).
but after I upgrade to office 2007, even after I select "allow" on security
warning, I check sent folder, there is no email sent out. and the receiver
does not receive emails.

What should I do to let macros in a word doc sending emails through outlook
2007?

Thanks a lot! have a great day!

  #3  
Old August 21st 07, 08:10 PM posted to microsoft.public.outlook.program_vba
david f[_2_]
external usenet poster
 
Posts: 7
Default Send emails through outlook 2007

I run the code step by step. there is no error when I debug it.
the code is like this:

Private Sub SendEmail_Click()

Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem

'Get Outlook if it's running
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err 0 Then
Set oOutlookApp = CreateObject("Outlook.Application")
End If

'Create a new mailitem
Set oItem = oOutlookApp.CreateItem(olMailItem)

With oItem

.To =
.CC = "Scheduler"
.Subject = "subject"
.Body = "Meeting Generated Task" + Chr(13) +
"-----------------------------------" + Chr(13)

'Add flag
.FlagDueBy = ActiveDocument.FormFields("End_Date").Result
.FlagStatus = olFlagMarked
.FlagIcon = olRedFlagIcon
.Categories = ActiveDocument.FormFields("Categories").Result
.Send
End With

'Clean up
Set oItem = Nothing
Set oOutlookApp = Nothing

End Sub


"Eric Legault [MVP - Outlook]" wrote:

Do you have any error handling in your code? Can you step through it without
error?

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"david f" wrote:

I have a word doc that can generate emails and send out them through outlook.
it works fine when I use outlook 2003(I chose yes when the outlook security
asked me if I want to send mail).
but after I upgrade to office 2007, even after I select "allow" on security
warning, I check sent folder, there is no email sent out. and the receiver
does not receive emails.

What should I do to let macros in a word doc sending emails through outlook
2007?

Thanks a lot! have a great day!

  #4  
Old August 21st 07, 08:18 PM posted to microsoft.public.outlook.program_vba
david f[_2_]
external usenet poster
 
Posts: 7
Default Send emails through outlook 2007

I changed the code .send to .display. the generated mail showed up in
outlook2007. but .send function seems not been performed.

Whan should I do? Thanks a lot.

"david f" wrote:

I run the code step by step. there is no error when I debug it.
the code is like this:

Private Sub SendEmail_Click()

Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem

'Get Outlook if it's running
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err 0 Then
Set oOutlookApp = CreateObject("Outlook.Application")
End If

'Create a new mailitem
Set oItem = oOutlookApp.CreateItem(olMailItem)

With oItem

.To =
.CC = "Scheduler"
.Subject = "subject"
.Body = "Meeting Generated Task" + Chr(13) +
"-----------------------------------" + Chr(13)

'Add flag
.FlagDueBy = ActiveDocument.FormFields("End_Date").Result
.FlagStatus = olFlagMarked
.FlagIcon = olRedFlagIcon
.Categories = ActiveDocument.FormFields("Categories").Result
.Send
End With

'Clean up
Set oItem = Nothing
Set oOutlookApp = Nothing

End Sub


"Eric Legault [MVP - Outlook]" wrote:

Do you have any error handling in your code? Can you step through it without
error?

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"david f" wrote:

I have a word doc that can generate emails and send out them through outlook.
it works fine when I use outlook 2003(I chose yes when the outlook security
asked me if I want to send mail).
but after I upgrade to office 2007, even after I select "allow" on security
warning, I check sent folder, there is no email sent out. and the receiver
does not receive emails.

What should I do to let macros in a word doc sending emails through outlook
2007?

Thanks a lot! have a great day!

  #5  
Old August 21st 07, 08:34 PM posted to microsoft.public.outlook.program_vba
david f[_2_]
external usenet poster
 
Posts: 7
Default Send emails through outlook 2007

I fixed it. the problem caused by the cc field. I have two people in
scheduler. so the mail did not send out.

I found this problem by changing send to display, then clicked on send
button. the mail did not send out because the system asked me to comfirm
which scheduler i'd like to send to. I deleted that cc line then it works
fine.

Thank you very much. Have a great day!

"david f" wrote:

I changed the code .send to .display. the generated mail showed up in
outlook2007. but .send function seems not been performed.

Whan should I do? Thanks a lot.

"david f" wrote:

I run the code step by step. there is no error when I debug it.
the code is like this:

Private Sub SendEmail_Click()

Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem

'Get Outlook if it's running
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err 0 Then
Set oOutlookApp = CreateObject("Outlook.Application")
End If

'Create a new mailitem
Set oItem = oOutlookApp.CreateItem(olMailItem)

With oItem

.To =
.CC = "Scheduler"
.Subject = "subject"
.Body = "Meeting Generated Task" + Chr(13) +
"-----------------------------------" + Chr(13)

'Add flag
.FlagDueBy = ActiveDocument.FormFields("End_Date").Result
.FlagStatus = olFlagMarked
.FlagIcon = olRedFlagIcon
.Categories = ActiveDocument.FormFields("Categories").Result
.Send
End With

'Clean up
Set oItem = Nothing
Set oOutlookApp = Nothing

End Sub


"Eric Legault [MVP - Outlook]" wrote:

Do you have any error handling in your code? Can you step through it without
error?

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"david f" wrote:

I have a word doc that can generate emails and send out them through outlook.
it works fine when I use outlook 2003(I chose yes when the outlook security
asked me if I want to send mail).
but after I upgrade to office 2007, even after I select "allow" on security
warning, I check sent folder, there is no email sent out. and the receiver
does not receive emails.

What should I do to let macros in a word doc sending emails through outlook
2007?

Thanks a lot! have a great day!

  #6  
Old August 21st 07, 08:36 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Send emails through outlook 2007

If you comment out Send and use thet Display method instead it will of course
not send the e-mail until the user clicks the Send button!

Try commenting out all the MailItem properties you are setting except the
..To and .Subject lines, and try the Send method again. I have a hunch
something is wrong with either the Cc, Body, Categories or Flag properties -
but nothing that's obviously apparent.

Is 'Scheduler' resolved if you manually type that in the To: field?

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"david f" wrote:

I changed the code .send to .display. the generated mail showed up in
outlook2007. but .send function seems not been performed.

Whan should I do? Thanks a lot.

"david f" wrote:

I run the code step by step. there is no error when I debug it.
the code is like this:

Private Sub SendEmail_Click()

Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem

'Get Outlook if it's running
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err 0 Then
Set oOutlookApp = CreateObject("Outlook.Application")
End If

'Create a new mailitem
Set oItem = oOutlookApp.CreateItem(olMailItem)

With oItem

.To =
.CC = "Scheduler"
.Subject = "subject"
.Body = "Meeting Generated Task" + Chr(13) +
"-----------------------------------" + Chr(13)

'Add flag
.FlagDueBy = ActiveDocument.FormFields("End_Date").Result
.FlagStatus = olFlagMarked
.FlagIcon = olRedFlagIcon
.Categories = ActiveDocument.FormFields("Categories").Result
.Send
End With

'Clean up
Set oItem = Nothing
Set oOutlookApp = Nothing

End Sub


"Eric Legault [MVP - Outlook]" wrote:

Do you have any error handling in your code? Can you step through it without
error?

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"david f" wrote:

I have a word doc that can generate emails and send out them through outlook.
it works fine when I use outlook 2003(I chose yes when the outlook security
asked me if I want to send mail).
but after I upgrade to office 2007, even after I select "allow" on security
warning, I check sent folder, there is no email sent out. and the receiver
does not receive emails.

What should I do to let macros in a word doc sending emails through outlook
2007?

Thanks a lot! have a great day!

  #7  
Old August 21st 07, 08:46 PM posted to microsoft.public.outlook.program_vba
david f[_2_]
external usenet poster
 
Posts: 7
Default Send emails through outlook 2007

Thanks a lot! That really helps.
Have a great day

"Eric Legault [MVP - Outlook]" wrote:

If you comment out Send and use thet Display method instead it will of course
not send the e-mail until the user clicks the Send button!

Try commenting out all the MailItem properties you are setting except the
.To and .Subject lines, and try the Send method again. I have a hunch
something is wrong with either the Cc, Body, Categories or Flag properties -
but nothing that's obviously apparent.

Is 'Scheduler' resolved if you manually type that in the To: field?

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"david f" wrote:

I changed the code .send to .display. the generated mail showed up in
outlook2007. but .send function seems not been performed.

Whan should I do? Thanks a lot.

"david f" wrote:

I run the code step by step. there is no error when I debug it.
the code is like this:

Private Sub SendEmail_Click()

Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem

'Get Outlook if it's running
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err 0 Then
Set oOutlookApp = CreateObject("Outlook.Application")
End If

'Create a new mailitem
Set oItem = oOutlookApp.CreateItem(olMailItem)

With oItem

.To =
.CC = "Scheduler"
.Subject = "subject"
.Body = "Meeting Generated Task" + Chr(13) +
"-----------------------------------" + Chr(13)

'Add flag
.FlagDueBy = ActiveDocument.FormFields("End_Date").Result
.FlagStatus = olFlagMarked
.FlagIcon = olRedFlagIcon
.Categories = ActiveDocument.FormFields("Categories").Result
.Send
End With

'Clean up
Set oItem = Nothing
Set oOutlookApp = Nothing

End Sub


"Eric Legault [MVP - Outlook]" wrote:

Do you have any error handling in your code? Can you step through it without
error?

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"david f" wrote:

I have a word doc that can generate emails and send out them through outlook.
it works fine when I use outlook 2003(I chose yes when the outlook security
asked me if I want to send mail).
but after I upgrade to office 2007, even after I select "allow" on security
warning, I check sent folder, there is no email sent out. and the receiver
does not receive emails.

What should I do to let macros in a word doc sending emails through outlook
2007?

Thanks a lot! have a great day!

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2007 cannot send emails but can recieve them ok? Dougy Outlook - Installation 2 July 27th 07 03:28 PM
Unable to receive emails in Outlook 2007 but can send email no pro braz Outlook - Installation 5 July 24th 07 09:54 AM
Outlook 2007 cannot send emails john doe Outlook - General Queries 11 April 10th 07 09:41 PM
Unable to receive any emails. Can send emails OK Davidd Outlook Express 2 October 4th 06 01:30 PM
Cant send emails and can only recieve emails from one msn account [email protected] Outlook Express 2 September 25th 06 09:13 PM


All times are GMT +1. The time now is 08:08 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.