PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Re: Open Email For Edit????
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Re: Open Email For Edit????
![]() |
Re: Open Email For Edit???? |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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" <JeffC@discussions.microsoft.com> wrote in message news:8C8CE26D-0220-49AC-BE88-468B45C9B13C@microsoft.com... >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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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" <JeffC@discussions.microsoft.com> wrote in message news:C7C98739-CB25-45DD-AEDE-B336529E657E@microsoft.com... > 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" <JeffC@discussions.microsoft.com> wrote in message >> news:8C8CE26D-0220-49AC-BE88-468B45C9B13C@microsoft.com... >> >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 |
|
Guest
Posts: n/a
|
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" <JeffC@discussions.microsoft.com> wrote in message > news:C7C98739-CB25-45DD-AEDE-B336529E657E@microsoft.com... > > 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" <JeffC@discussions.microsoft.com> wrote in message > >> news:8C8CE26D-0220-49AC-BE88-468B45C9B13C@microsoft.com... > >> >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 |
|
Guest
Posts: n/a
|
Call doc.Close beflore calling Display.
Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jeff C" <JeffC@discussions.microsoft.com> wrote in message news:F3F9F8C6-7724-4E2F-A866-586BC2B152E9@microsoft.com... > 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("FullPathOfMyAccessReportExported") > 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" <JeffC@discussions.microsoft.com> wrote in message >> news:C7C98739-CB25-45DD-AEDE-B336529E657E@microsoft.com... >> > 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" <JeffC@discussions.microsoft.com> wrote in message >> >> news:8C8CE26D-0220-49AC-BE88-468B45C9B13C@microsoft.com... >> >> >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 |
|
Guest
Posts: n/a
|
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" <JeffC@discussions.microsoft.com> wrote in message news:207172E1-71E4-4FC9-80F2-DA47D53D8D92@microsoft.com... > 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" <JeffC@discussions.microsoft.com> wrote in message >> news:F3F9F8C6-7724-4E2F-A866-586BC2B152E9@microsoft.com... >> > 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("FullPathOfMyAccessReportExported") >> > 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" <JeffC@discussions.microsoft.com> wrote in message >> >> news:C7C98739-CB25-45DD-AEDE-B336529E657E@microsoft.com... >> >> > 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" <JeffC@discussions.microsoft.com> wrote in message >> >> >> news:8C8CE26D-0220-49AC-BE88-468B45C9B13C@microsoft.com... >> >> >> >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 >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> |
|
|
|
#6 |
|
Guest
Posts: n/a
|
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 there: 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" <dmitry@dimastr.com> wrote in message news:uQfLMM9HHHA.3616@TK2MSFTNGP06.phx.gbl... > 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" <JeffC@discussions.microsoft.com> wrote in message > news:207172E1-71E4-4FC9-80F2-DA47D53D8D92@microsoft.com... >> 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" <JeffC@discussions.microsoft.com> wrote in message >>> news:F3F9F8C6-7724-4E2F-A866-586BC2B152E9@microsoft.com... >>> > 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("FullPathOfMyAccessReportExported") >>> > 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" <JeffC@discussions.microsoft.com> wrote in message >>> >> news:C7C98739-CB25-45DD-AEDE-B336529E657E@microsoft.com... >>> >> > 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" <JeffC@discussions.microsoft.com> wrote in message >>> >> >> news:8C8CE26D-0220-49AC-BE88-468B45C9B13C@microsoft.com... >>> >> >> >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 >>> >> >> >>> >> >> >>> >> >> >>> >> >>> >> >>> >> >>> >>> >>> > > |
|
|
|
#7 |
|
Guest
Posts: n/a
|
-- Jeff C Live Well .. Be Happy In All You Do "Dmitry Streblechenko" wrote: > 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 > Dmitry: I am a bit knowledgeable about MS Access and just limp along with the other pieces of MS Office Pro. From Access I am able to export the report, that is needed in the Outlook message body, in rtf or txt format. I had worked through the code I used on an earlier project. I do not necessarily need to use Word, I am just trying to get the report placed in the body of the message. If you have time, would you please offer alternative lines of code reflecting your suggestions so I have an idea what I should replace in what I have now? Thanks very much, you're appreciated! |
|
|
|
#8 |
|
Guest
Posts: n/a
|
Thanks Sue:
You originally helped me as I was assembling the code I have been using here. Are you saying that: doc.Activate doc.MailEnvelope.EnvelopeShow Will open the Outlook email with the document in the message body there-by avoiding the security warning??? -- Jeff C Live Well .. Be Happy In All You Do "Sue Mosher [MVP-Outlook]" wrote: > 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 there: > > doc.Activate > doc.MailEnvelope.EnvelopeShow > |
|
|
|
#9 |
|
Guest
Posts: n/a
|
No, I'm saying that using EnvelopeShow will open the Word document with all the controls the user needs to address and send the message. If you want to show an Outlook item, you must use the other procedure I outlined.
-- 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 "Jeff C" <JeffC@discussions.microsoft.com> wrote in message news:69F895C7-DB59-49FD-AEDD-977F6EDED233@microsoft.com... > Thanks Sue: > > You originally helped me as I was assembling the code I have been using > here. > > Are you saying that: > > doc.Activate > doc.MailEnvelope.EnvelopeShow > > Will open the Outlook email with the document in the message body there-by > avoiding the security warning??? > -- > Jeff C > Live Well .. Be Happy In All You Do > > > "Sue Mosher [MVP-Outlook]" wrote: > >> 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 there: >> >> doc.Activate >> doc.MailEnvelope.EnvelopeShow >> > |
|
|
|
#10 |
|
Guest
Posts: n/a
|
Is there an example I could look at somewhere you could point me too? The
procedures you are referencing are a bit beyond my knowledge at this point. But I would really like to figure this out. Thank you. -- Jeff C Live Well .. Be Happy In All You Do "Sue Mosher [MVP-Outlook]" wrote: > No, I'm saying that using EnvelopeShow will open the Word document with all the controls the user needs to address and send the message. If you want to show an Outlook item, you must use the other procedure I outlined. > > -- > 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 > > "Jeff C" <JeffC@discussions.microsoft.com> wrote in message news:69F895C7-DB59-49FD-AEDD-977F6EDED233@microsoft.com... > > Thanks Sue: > > > > You originally helped me as I was assembling the code I have been using > > here. > > > > Are you saying that: > > > > doc.Activate > > doc.MailEnvelope.EnvelopeShow > > > > Will open the Outlook email with the document in the message body there-by > > avoiding the security warning??? > > -- > > Jeff C > > Live Well .. Be Happy In All You Do > > > > > > "Sue Mosher [MVP-Outlook]" wrote: > > > >> 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 there: > >> > >> doc.Activate > >> doc.MailEnvelope.EnvelopeShow > >> > > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

