![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I am using the following to send a simple text report in the message body of
an Outlook email (Office 2003) from an MS Access database tool. Because of the security features I get the warning about something trying to send an email which requires the user to acknowledge by clicking on the yes button. I know about the “ClickYes” program but I would much rather just have the email open for editing requiring the user to manually send the email rather than getting the warning message. Is there any modification or change I could implement to the code below that will make this happen? Thank you very much. DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70 DoCmd.OutputTo acOutputReport, "MyAccessReport", acFormatRTF, "Full Path To MyAccessReport" Dim wdApp As Word.Application Dim doc As Word.Document Dim Report As MailItem Set wdApp = New Word.Application Set doc = wdApp.Documents.Open("Full Path To MyAccessReport ") Set Report = doc.MailEnvelope.Item Report.To = [Forms]![MyAccessForm].[txtEmail] Report.Subject = "MyEmailSubject" Report.Display Report.Send wdApp.Quit False Set doc = Nothing Set wdApp = Nothing DoCmd.Close Application.Quit acQuitSaveAll -- Jeff C Live Well .. Be Happy In All You Do |
Ads |
#2
|
|||
|
|||
![]()
Display message modally and do not call Send, leave that to a user:
.... Report.Display(TRUE) wdApp.Quit False Set doc = Nothing Set wdApp = Nothing DoCmd.Close Application.Quit acQuitSaveAll Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... I am using the following to send a simple text report in the message body of an Outlook email (Office 2003) from an MS Access database tool. Because of the security features I get the warning about something trying to send an email which requires the user to acknowledge by clicking on the yes button. I know about the "ClickYes" program but I would much rather just have the email open for editing requiring the user to manually send the email rather than getting the warning message. Is there any modification or change I could implement to the code below that will make this happen? Thank you very much. DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70 DoCmd.OutputTo acOutputReport, "MyAccessReport", acFormatRTF, "Full Path To MyAccessReport" Dim wdApp As Word.Application Dim doc As Word.Document Dim Report As MailItem Set wdApp = New Word.Application Set doc = wdApp.Documents.Open("Full Path To MyAccessReport ") Set Report = doc.MailEnvelope.Item Report.To = [Forms]![MyAccessForm].[txtEmail] Report.Subject = "MyEmailSubject" Report.Display Report.Send wdApp.Quit False Set doc = Nothing Set wdApp = Nothing DoCmd.Close Application.Quit acQuitSaveAll -- Jeff C Live Well .. Be Happy In All You Do |
#3
|
|||
|
|||
![]()
Thanks for your help Dmitry, but that doesn't seem to work. The code runs
without an error but there is no email generated. What could that be?? -- Jeff C Live Well .. Be Happy In All You Do "Dmitry Streblechenko" wrote: Display message modally and do not call Send, leave that to a user: .... Report.Display(TRUE) wdApp.Quit False Set doc = Nothing Set wdApp = Nothing DoCmd.Close Application.Quit acQuitSaveAll Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... I am using the following to send a simple text report in the message body of an Outlook email (Office 2003) from an MS Access database tool. Because of the security features I get the warning about something trying to send an email which requires the user to acknowledge by clicking on the yes button. I know about the "ClickYes" program but I would much rather just have the email open for editing requiring the user to manually send the email rather than getting the warning message. Is there any modification or change I could implement to the code below that will make this happen? Thank you very much. DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70 DoCmd.OutputTo acOutputReport, "MyAccessReport", acFormatRTF, "Full Path To MyAccessReport" Dim wdApp As Word.Application Dim doc As Word.Document Dim Report As MailItem Set wdApp = New Word.Application Set doc = wdApp.Documents.Open("Full Path To MyAccessReport ") Set Report = doc.MailEnvelope.Item Report.To = [Forms]![MyAccessForm].[txtEmail] Report.Subject = "MyEmailSubject" Report.Display Report.Send wdApp.Quit False Set doc = Nothing Set wdApp = Nothing DoCmd.Close Application.Quit acQuitSaveAll -- Jeff C Live Well .. Be Happy In All You Do |
#4
|
|||
|
|||
![]()
What happens when you step through the code? Do you have "on error resumee
next" anywhere? Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... Thanks for your help Dmitry, but that doesn't seem to work. The code runs without an error but there is no email generated. What could that be?? -- Jeff C Live Well .. Be Happy In All You Do "Dmitry Streblechenko" wrote: Display message modally and do not call Send, leave that to a user: .... Report.Display(TRUE) wdApp.Quit False Set doc = Nothing Set wdApp = Nothing DoCmd.Close Application.Quit acQuitSaveAll Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... I am using the following to send a simple text report in the message body of an Outlook email (Office 2003) from an MS Access database tool. Because of the security features I get the warning about something trying to send an email which requires the user to acknowledge by clicking on the yes button. I know about the "ClickYes" program but I would much rather just have the email open for editing requiring the user to manually send the email rather than getting the warning message. Is there any modification or change I could implement to the code below that will make this happen? Thank you very much. DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70 DoCmd.OutputTo acOutputReport, "MyAccessReport", acFormatRTF, "Full Path To MyAccessReport" Dim wdApp As Word.Application Dim doc As Word.Document Dim Report As MailItem Set wdApp = New Word.Application Set doc = wdApp.Documents.Open("Full Path To MyAccessReport ") Set Report = doc.MailEnvelope.Item Report.To = [Forms]![MyAccessForm].[txtEmail] Report.Subject = "MyEmailSubject" Report.Display Report.Send wdApp.Quit False Set doc = Nothing Set wdApp = Nothing DoCmd.Close Application.Quit acQuitSaveAll -- Jeff C Live Well .. Be Happy In All You Do |
#5
|
|||
|
|||
![]()
This is the entire code that I changed to reflect your suggestion. The code
just runs without any breaks, the report is exported in rtf format but outlook does not open and no mail is displayed. DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70 DoCmd.OutputTo acOutputReport, "MyAccessReport", acFormatRTF, "FullPathOfMyAccessReportExported" Dim wdApp As Word.Application Dim doc As Word.Document Dim Report As MailItem Set wdApp = New Word.Application Set doc = wdApp.Documents.Open("FullPathOfMyAccessReportExpo rted") Set Report = doc.MailEnvelope.Item Report.To = [Forms]![MyAccessForm].[txtEmail] Report.Subject = "MySubject" Report.Display (True) 'Report.Send wdApp.Quit False Set doc = Nothing Set wdApp = Nothing -- Jeff C Live Well .. Be Happy In All You Do "Dmitry Streblechenko" wrote: What happens when you step through the code? Do you have "on error resumee next" anywhere? Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... Thanks for your help Dmitry, but that doesn't seem to work. The code runs without an error but there is no email generated. What could that be?? -- Jeff C Live Well .. Be Happy In All You Do "Dmitry Streblechenko" wrote: Display message modally and do not call Send, leave that to a user: .... Report.Display(TRUE) wdApp.Quit False Set doc = Nothing Set wdApp = Nothing DoCmd.Close Application.Quit acQuitSaveAll Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... I am using the following to send a simple text report in the message body of an Outlook email (Office 2003) from an MS Access database tool. Because of the security features I get the warning about something trying to send an email which requires the user to acknowledge by clicking on the yes button. I know about the "ClickYes" program but I would much rather just have the email open for editing requiring the user to manually send the email rather than getting the warning message. Is there any modification or change I could implement to the code below that will make this happen? Thank you very much. DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70 DoCmd.OutputTo acOutputReport, "MyAccessReport", acFormatRTF, "Full Path To MyAccessReport" Dim wdApp As Word.Application Dim doc As Word.Document Dim Report As MailItem Set wdApp = New Word.Application Set doc = wdApp.Documents.Open("Full Path To MyAccessReport ") Set Report = doc.MailEnvelope.Item Report.To = [Forms]![MyAccessForm].[txtEmail] Report.Subject = "MyEmailSubject" Report.Display Report.Send wdApp.Quit False Set doc = Nothing Set wdApp = Nothing DoCmd.Close Application.Quit acQuitSaveAll -- Jeff C Live Well .. Be Happy In All You Do |
#6
|
|||
|
|||
![]()
I am wondering if I somehow have to open and Outlook Application???
Sorry about the naive questions, I guess I know just enought to get myself in trouble (but I am learning thanks to you) Dmitry Streblechenko wrote: What happens when you step through the code? Do you have "on error resumee next" anywhere? Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... Thanks for your help Dmitry, but that doesn't seem to work. The code runs without an error but there is no email generated. What could that be?? -- Jeff C Live Well .. Be Happy In All You Do "Dmitry Streblechenko" wrote: Display message modally and do not call Send, leave that to a user: .... Report.Display(TRUE) wdApp.Quit False Set doc = Nothing Set wdApp = Nothing DoCmd.Close Application.Quit acQuitSaveAll Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... I am using the following to send a simple text report in the message body of an Outlook email (Office 2003) from an MS Access database tool. Because of the security features I get the warning about something trying to send an email which requires the user to acknowledge by clicking on the yes button. I know about the "ClickYes" program but I would much rather just have the email open for editing requiring the user to manually send the email rather than getting the warning message. Is there any modification or change I could implement to the code below that will make this happen? Thank you very much. DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70 DoCmd.OutputTo acOutputReport, "MyAccessReport", acFormatRTF, "Full Path To MyAccessReport" Dim wdApp As Word.Application Dim doc As Word.Document Dim Report As MailItem Set wdApp = New Word.Application Set doc = wdApp.Documents.Open("Full Path To MyAccessReport ") Set Report = doc.MailEnvelope.Item Report.To = [Forms]![MyAccessForm].[txtEmail] Report.Subject = "MyEmailSubject" Report.Display Report.Send wdApp.Quit False Set doc = Nothing Set wdApp = Nothing DoCmd.Close Application.Quit acQuitSaveAll -- Jeff C Live Well .. Be Happy In All You Do |
#7
|
|||
|
|||
![]()
Call doc.Close beflore calling Display.
Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... This is the entire code that I changed to reflect your suggestion. The code just runs without any breaks, the report is exported in rtf format but outlook does not open and no mail is displayed. DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70 DoCmd.OutputTo acOutputReport, "MyAccessReport", acFormatRTF, "FullPathOfMyAccessReportExported" Dim wdApp As Word.Application Dim doc As Word.Document Dim Report As MailItem Set wdApp = New Word.Application Set doc = wdApp.Documents.Open("FullPathOfMyAccessReportExpo rted") Set Report = doc.MailEnvelope.Item Report.To = [Forms]![MyAccessForm].[txtEmail] Report.Subject = "MySubject" Report.Display (True) 'Report.Send wdApp.Quit False Set doc = Nothing Set wdApp = Nothing -- Jeff C Live Well .. Be Happy In All You Do "Dmitry Streblechenko" wrote: What happens when you step through the code? Do you have "on error resumee next" anywhere? Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... Thanks for your help Dmitry, but that doesn't seem to work. The code runs without an error but there is no email generated. What could that be?? -- Jeff C Live Well .. Be Happy In All You Do "Dmitry Streblechenko" wrote: Display message modally and do not call Send, leave that to a user: .... Report.Display(TRUE) wdApp.Quit False Set doc = Nothing Set wdApp = Nothing DoCmd.Close Application.Quit acQuitSaveAll Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... I am using the following to send a simple text report in the message body of an Outlook email (Office 2003) from an MS Access database tool. Because of the security features I get the warning about something trying to send an email which requires the user to acknowledge by clicking on the yes button. I know about the "ClickYes" program but I would much rather just have the email open for editing requiring the user to manually send the email rather than getting the warning message. Is there any modification or change I could implement to the code below that will make this happen? Thank you very much. DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70 DoCmd.OutputTo acOutputReport, "MyAccessReport", acFormatRTF, "Full Path To MyAccessReport" Dim wdApp As Word.Application Dim doc As Word.Document Dim Report As MailItem Set wdApp = New Word.Application Set doc = wdApp.Documents.Open("Full Path To MyAccessReport ") Set Report = doc.MailEnvelope.Item Report.To = [Forms]![MyAccessForm].[txtEmail] Report.Subject = "MyEmailSubject" Report.Display Report.Send wdApp.Quit False Set doc = Nothing Set wdApp = Nothing DoCmd.Close Application.Quit acQuitSaveAll -- Jeff C Live Well .. Be Happy In All You Do |
#8
|
|||
|
|||
![]()
Dmitry:
I have tried inserting that call on every line before Display and it does allow Outlook to open but the message body is empty (the mailenvelope.item exported report is missing) -- Jeff C Live Well .. Be Happy In All You Do "Dmitry Streblechenko" wrote: Call doc.Close beflore calling Display. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... This is the entire code that I changed to reflect your suggestion. The code just runs without any breaks, the report is exported in rtf format but outlook does not open and no mail is displayed. DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70 DoCmd.OutputTo acOutputReport, "MyAccessReport", acFormatRTF, "FullPathOfMyAccessReportExported" Dim wdApp As Word.Application Dim doc As Word.Document Dim Report As MailItem Set wdApp = New Word.Application Set doc = wdApp.Documents.Open("FullPathOfMyAccessReportExpo rted") Set Report = doc.MailEnvelope.Item Report.To = [Forms]![MyAccessForm].[txtEmail] Report.Subject = "MySubject" Report.Display (True) 'Report.Send wdApp.Quit False Set doc = Nothing Set wdApp = Nothing -- Jeff C Live Well .. Be Happy In All You Do "Dmitry Streblechenko" wrote: What happens when you step through the code? Do you have "on error resumee next" anywhere? Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... Thanks for your help Dmitry, but that doesn't seem to work. The code runs without an error but there is no email generated. What could that be?? -- Jeff C Live Well .. Be Happy In All You Do "Dmitry Streblechenko" wrote: Display message modally and do not call Send, leave that to a user: .... Report.Display(TRUE) wdApp.Quit False Set doc = Nothing Set wdApp = Nothing DoCmd.Close Application.Quit acQuitSaveAll Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... I am using the following to send a simple text report in the message body of an Outlook email (Office 2003) from an MS Access database tool. Because of the security features I get the warning about something trying to send an email which requires the user to acknowledge by clicking on the yes button. I know about the "ClickYes" program but I would much rather just have the email open for editing requiring the user to manually send the email rather than getting the warning message. Is there any modification or change I could implement to the code below that will make this happen? Thank you very much. DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70 DoCmd.OutputTo acOutputReport, "MyAccessReport", acFormatRTF, "Full Path To MyAccessReport" Dim wdApp As Word.Application Dim doc As Word.Document Dim Report As MailItem Set wdApp = New Word.Application Set doc = wdApp.Documents.Open("Full Path To MyAccessReport ") Set Report = doc.MailEnvelope.Item Report.To = [Forms]![MyAccessForm].[txtEmail] Report.Subject = "MyEmailSubject" Report.Display Report.Send wdApp.Quit False Set doc = Nothing Set wdApp = Nothing DoCmd.Close Application.Quit acQuitSaveAll -- Jeff C Live Well .. Be Happy In All You Do |
#9
|
|||
|
|||
![]()
Hmmm.. I don't use Word for anything e-mail related, but it looks like you'd
be better off explicitly creating an instance of the Outlook.Application object, creating a new message (Application.CreateItem), setting the MailItem.HTMLBody property to the document contents exported from Word and then displaying it (MailItem.Display) Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... Dmitry: I have tried inserting that call on every line before Display and it does allow Outlook to open but the message body is empty (the mailenvelope.item exported report is missing) -- Jeff C Live Well .. Be Happy In All You Do "Dmitry Streblechenko" wrote: Call doc.Close beflore calling Display. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... This is the entire code that I changed to reflect your suggestion. The code just runs without any breaks, the report is exported in rtf format but outlook does not open and no mail is displayed. DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70 DoCmd.OutputTo acOutputReport, "MyAccessReport", acFormatRTF, "FullPathOfMyAccessReportExported" Dim wdApp As Word.Application Dim doc As Word.Document Dim Report As MailItem Set wdApp = New Word.Application Set doc = wdApp.Documents.Open("FullPathOfMyAccessReportExpo rted") Set Report = doc.MailEnvelope.Item Report.To = [Forms]![MyAccessForm].[txtEmail] Report.Subject = "MySubject" Report.Display (True) 'Report.Send wdApp.Quit False Set doc = Nothing Set wdApp = Nothing -- Jeff C Live Well .. Be Happy In All You Do "Dmitry Streblechenko" wrote: What happens when you step through the code? Do you have "on error resumee next" anywhere? Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... Thanks for your help Dmitry, but that doesn't seem to work. The code runs without an error but there is no email generated. What could that be?? -- Jeff C Live Well .. Be Happy In All You Do "Dmitry Streblechenko" wrote: Display message modally and do not call Send, leave that to a user: .... Report.Display(TRUE) wdApp.Quit False Set doc = Nothing Set wdApp = Nothing DoCmd.Close Application.Quit acQuitSaveAll Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... I am using the following to send a simple text report in the message body of an Outlook email (Office 2003) from an MS Access database tool. Because of the security features I get the warning about something trying to send an email which requires the user to acknowledge by clicking on the yes button. I know about the "ClickYes" program but I would much rather just have the email open for editing requiring the user to manually send the rather than getting the warning message. Is there any modification or change I could implement to the code below that will make this happen? Thank you very much. DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70 DoCmd.OutputTo acOutputReport, "MyAccessReport", acFormatRTF, "Full Path To MyAccessReport" Dim wdApp As Word.Application Dim doc As Word.Document Dim Report As MailItem Set wdApp = New Word.Application Set doc = wdApp.Documents.Open("Full Path To MyAccessReport ") Set Report = doc.MailEnvelope.Item Report.To = [Forms]![MyAccessForm].[txtEmail] Report.Subject = "MyEmailSubject" Report.Display Report.Send wdApp.Quit False Set doc = Nothing Set wdApp = Nothing DoCmd.Close Application.Quit acQuitSaveAll -- Jeff C Live Well .. Be Happy In All You Do |
#10
|
|||
|
|||
![]()
To show the message created with MailEnvelope as an Outlook message, you'd need to save it, get the EntryID, then return a new item with Namespace.GetItemFromID and finally display that item.
Why not just open the Word doc and show the envelope the doc.Activate doc.MailEnvelope.EnvelopeShow -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Dmitry Streblechenko" wrote in message ... Hmmm.. I don't use Word for anything e-mail related, but it looks like you'd be better off explicitly creating an instance of the Outlook.Application object, creating a new message (Application.CreateItem), setting the MailItem.HTMLBody property to the document contents exported from Word and then displaying it (MailItem.Display) Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... Dmitry: I have tried inserting that call on every line before Display and it does allow Outlook to open but the message body is empty (the mailenvelope.item exported report is missing) -- Jeff C Live Well .. Be Happy In All You Do "Dmitry Streblechenko" wrote: Call doc.Close beflore calling Display. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... This is the entire code that I changed to reflect your suggestion. The code just runs without any breaks, the report is exported in rtf format but outlook does not open and no mail is displayed. DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70 DoCmd.OutputTo acOutputReport, "MyAccessReport", acFormatRTF, "FullPathOfMyAccessReportExported" Dim wdApp As Word.Application Dim doc As Word.Document Dim Report As MailItem Set wdApp = New Word.Application Set doc = wdApp.Documents.Open("FullPathOfMyAccessReportExpo rted") Set Report = doc.MailEnvelope.Item Report.To = [Forms]![MyAccessForm].[txtEmail] Report.Subject = "MySubject" Report.Display (True) 'Report.Send wdApp.Quit False Set doc = Nothing Set wdApp = Nothing -- Jeff C Live Well .. Be Happy In All You Do "Dmitry Streblechenko" wrote: What happens when you step through the code? Do you have "on error resumee next" anywhere? Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... Thanks for your help Dmitry, but that doesn't seem to work. The code runs without an error but there is no email generated. What could that be?? -- Jeff C Live Well .. Be Happy In All You Do "Dmitry Streblechenko" wrote: Display message modally and do not call Send, leave that to a user: .... Report.Display(TRUE) wdApp.Quit False Set doc = Nothing Set wdApp = Nothing DoCmd.Close Application.Quit acQuitSaveAll Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" wrote in message ... I am using the following to send a simple text report in the message body of an Outlook email (Office 2003) from an MS Access database tool. Because of the security features I get the warning about something trying to send an email which requires the user to acknowledge by clicking on the yes button. I know about the "ClickYes" program but I would much rather just have the email open for editing requiring the user to manually send the rather than getting the warning message. Is there any modification or change I could implement to the code below that will make this happen? Thank you very much. DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70 DoCmd.OutputTo acOutputReport, "MyAccessReport", acFormatRTF, "Full Path To MyAccessReport" Dim wdApp As Word.Application Dim doc As Word.Document Dim Report As MailItem Set wdApp = New Word.Application Set doc = wdApp.Documents.Open("Full Path To MyAccessReport ") Set Report = doc.MailEnvelope.Item Report.To = [Forms]![MyAccessForm].[txtEmail] Report.Subject = "MyEmailSubject" Report.Display Report.Send wdApp.Quit False Set doc = Nothing Set wdApp = Nothing DoCmd.Close Application.Quit acQuitSaveAll -- Jeff C Live Well .. Be Happy In All You Do |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cannot edit a contact's email address | [email protected] | Outlook - Using Contacts | 11 | December 21st 06 08:52 PM |
Open For Edit | Jeff C | Outlook and VBA | 0 | September 28th 06 12:34 AM |
email subject edit?? | Layton Traver | Outlook Express | 2 | August 19th 06 01:44 AM |
Can't use Word to edit email with Office 2003 | [email protected] | Outlook - General Queries | 6 | February 15th 06 05:14 PM |
Outlook cant find Word when trying to edit email. | John | Outlook - Installation | 0 | February 6th 06 05:22 AM |