| Home | Forums | Reviews | Articles | Register |
![]() |
| Thread Tools | Rate Thread |
|
|
|
| |
|
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
|
See http://www.outlookcode.com/article.aspx?ID=52 for your options with regard to the "object model guard" security in Outlook 2000 SP2 and later versions.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "SAm" <(E-Mail Removed)> wrote in message news:B8AB433E-6188-4E53-BE3D-(E-Mail Removed)... > Hi > > I have been on these boards the last few days try to learn how to do this, > but i am unable. > > i have successfully adapted code (thanks to the MSDN) that does exactly what > i need, e.g. send an email from microsoft access. however i get all these > warnings messages and i would like to get rid of them. i read up a lot of > postings on MSDN but i have no answers. plesae let me know what i can do > about it. i will post my code so that you can see what i am doing. btw, i am > also getting some message "type mismatch" which i can't figure out where it > comes from. > > here is my code. (its on a form as a seperate subroutine) > Sub sbSendMessage(Optional AttachmentPath) > On Error GoTo Err_ErrorMsgs > > Dim objOutlook As Outlook.Application > Dim objOutlookMsg As Outlook.MailItem > Dim objOutlookRecip As Outlook.Recipient > Dim objOutlookAttach As Outlook.Attachment > > ' Create the Outlook session. > Set objOutlook = CreateObject("Outlook.Application") > ' Create the message. > Set objOutlookMsg = objOutlook.CreateItem(olMailItem) > With objOutlookMsg > ' Add the To recipient(s) to the message. Substitute > ' your names here. > Set objOutlookRecip = .Recipients.Add(Me.txtEmailAddress) > objOutlookRecip.Type = olTo > ' Add the CC recipient(s) to the message. > Set objOutlookRecip = .Recipients.Add("(E-Mail Removed)") > objOutlookRecip.Type = olCC > ' Set the Subject, Body, and Importance of the message. > .Subject = Me.txtFacility.Column(0) & " Systems Audit " & Date > .Body = Me.txtEmailBodyText > ' Add attachments to the message. > If Not IsMissing(AttachmentPath) Then > Set objOutlookAttach = .Attachments.Add(AttachmentPath) > End If > ' Resolve each Recipient's name. > 'For Each objOutlookRecip In .Recipients > 'If Not objOutlookRecip.Resolve Then > 'objOutlookMsg.Display > 'End If > 'Next > .Display > '.Send > End With > Set objOutlookMsg = Nothing > Set objOutlook = Nothing > Set objOutlookRecip = Nothing > Set objOutlookAttach = Nothing > Err_ErrorMsgs: > If Err.Number = "287" Then > MsgBox "You clicked No to the Outlook security warning. " & _ > " Rerun the procedure and click Yes to access e-mail" & _ > " addresses to send your message. For more information," & _ > " see the document at http://www.microsoft.com/office" & _ > "/previous/outlook/downloads/security.asp. " > Else > MsgBox Err.Number, Err.Description > End If > End Sub > > thanks, > > sam |
|
||
|
||||
|
J Blessing
Guest
Posts: n/a
|
http://www.slipstick.com/outlook/esecup.htm
-- John Blessing http://www.LbeHelpdesk.com - Help Desk software priced to suit all businesses http://www.room-booking-software.com - Schedule rooms & equipment bookings for your meeting/class over the web. http://www.lbetoolbox.com - Remove Duplicates from MS Outlook, find/replace, send newsletters "SAm" <(E-Mail Removed)> wrote in message news:B8AB433E-6188-4E53-BE3D-(E-Mail Removed)... > Hi > > I have been on these boards the last few days try to learn how to do this, > but i am unable. > > i have successfully adapted code (thanks to the MSDN) that does exactly > what > i need, e.g. send an email from microsoft access. however i get all these > warnings messages and i would like to get rid of them. i read up a lot of > postings on MSDN but i have no answers. plesae let me know what i can do > about it. i will post my code so that you can see what i am doing. btw, i > am > also getting some message "type mismatch" which i can't figure out where > it > comes from. > > here is my code. (its on a form as a seperate subroutine) > Sub sbSendMessage(Optional AttachmentPath) > On Error GoTo Err_ErrorMsgs > > Dim objOutlook As Outlook.Application > Dim objOutlookMsg As Outlook.MailItem > Dim objOutlookRecip As Outlook.Recipient > Dim objOutlookAttach As Outlook.Attachment > > ' Create the Outlook session. > Set objOutlook = CreateObject("Outlook.Application") > ' Create the message. > Set objOutlookMsg = objOutlook.CreateItem(olMailItem) > With objOutlookMsg > ' Add the To recipient(s) to the message. Substitute > ' your names here. > Set objOutlookRecip = .Recipients.Add(Me.txtEmailAddress) > objOutlookRecip.Type = olTo > ' Add the CC recipient(s) to the message. > Set objOutlookRecip = .Recipients.Add("(E-Mail Removed)") > objOutlookRecip.Type = olCC > ' Set the Subject, Body, and Importance of the message. > .Subject = Me.txtFacility.Column(0) & " Systems Audit " & Date > .Body = Me.txtEmailBodyText > ' Add attachments to the message. > If Not IsMissing(AttachmentPath) Then > Set objOutlookAttach = .Attachments.Add(AttachmentPath) > End If > ' Resolve each Recipient's name. > 'For Each objOutlookRecip In .Recipients > 'If Not objOutlookRecip.Resolve Then > 'objOutlookMsg.Display > 'End If > 'Next > .Display > '.Send > End With > Set objOutlookMsg = Nothing > Set objOutlook = Nothing > Set objOutlookRecip = Nothing > Set objOutlookAttach = Nothing > Err_ErrorMsgs: > If Err.Number = "287" Then > MsgBox "You clicked No to the Outlook security warning. " & _ > " Rerun the procedure and click Yes to access e-mail" & _ > " addresses to send your message. For more information," & _ > " see the document at http://www.microsoft.com/office" & _ > "/previous/outlook/downloads/security.asp. " > Else > MsgBox Err.Number, Err.Description > End If > End Sub > > thanks, > > sam |
|
||
|
||||
|
=?Utf-8?B?U0Ft?=
Guest
Posts: n/a
|
thanks for your quick response. can you please explain what i should do with
this link. i already have seen it but i still don't know what i should do, what i should instal, and what will work for office 2003. sorry i am not so familiar with this. thanks, sam "J Blessing" wrote: > http://www.slipstick.com/outlook/esecup.htm > > > > -- > John Blessing > > http://www.LbeHelpdesk.com - Help Desk software priced to suit all > businesses > http://www.room-booking-software.com - Schedule rooms & equipment bookings > for your meeting/class over the web. > http://www.lbetoolbox.com - Remove Duplicates from MS Outlook, find/replace, > send newsletters > > "SAm" <(E-Mail Removed)> wrote in message > news:B8AB433E-6188-4E53-BE3D-(E-Mail Removed)... > > Hi > > > > I have been on these boards the last few days try to learn how to do this, > > but i am unable. > > > > i have successfully adapted code (thanks to the MSDN) that does exactly > > what > > i need, e.g. send an email from microsoft access. however i get all these > > warnings messages and i would like to get rid of them. i read up a lot of > > postings on MSDN but i have no answers. plesae let me know what i can do > > about it. i will post my code so that you can see what i am doing. btw, i > > am > > also getting some message "type mismatch" which i can't figure out where > > it > > comes from. > > > > here is my code. (its on a form as a seperate subroutine) > > Sub sbSendMessage(Optional AttachmentPath) > > On Error GoTo Err_ErrorMsgs > > > > Dim objOutlook As Outlook.Application > > Dim objOutlookMsg As Outlook.MailItem > > Dim objOutlookRecip As Outlook.Recipient > > Dim objOutlookAttach As Outlook.Attachment > > > > ' Create the Outlook session. > > Set objOutlook = CreateObject("Outlook.Application") > > ' Create the message. > > Set objOutlookMsg = objOutlook.CreateItem(olMailItem) > > With objOutlookMsg > > ' Add the To recipient(s) to the message. Substitute > > ' your names here. > > Set objOutlookRecip = .Recipients.Add(Me.txtEmailAddress) > > objOutlookRecip.Type = olTo > > ' Add the CC recipient(s) to the message. > > Set objOutlookRecip = .Recipients.Add("(E-Mail Removed)") > > objOutlookRecip.Type = olCC > > ' Set the Subject, Body, and Importance of the message. > > .Subject = Me.txtFacility.Column(0) & " Systems Audit " & Date > > .Body = Me.txtEmailBodyText > > ' Add attachments to the message. > > If Not IsMissing(AttachmentPath) Then > > Set objOutlookAttach = .Attachments.Add(AttachmentPath) > > End If > > ' Resolve each Recipient's name. > > 'For Each objOutlookRecip In .Recipients > > 'If Not objOutlookRecip.Resolve Then > > 'objOutlookMsg.Display > > 'End If > > 'Next > > .Display > > '.Send > > End With > > Set objOutlookMsg = Nothing > > Set objOutlook = Nothing > > Set objOutlookRecip = Nothing > > Set objOutlookAttach = Nothing > > Err_ErrorMsgs: > > If Err.Number = "287" Then > > MsgBox "You clicked No to the Outlook security warning. " & _ > > " Rerun the procedure and click Yes to access e-mail" & _ > > " addresses to send your message. For more information," & _ > > " see the document at http://www.microsoft.com/office" & _ > > "/previous/outlook/downloads/security.asp. " > > Else > > MsgBox Err.Number, Err.Description > > End If > > End Sub > > > > thanks, > > > > sam > > > |
|
||
|
||||
|
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
|
John's solution applies only if you use Exchange for mail, have a cooperative Exchange administrator, and are willing to sacrifice some security for the sake of your application. It would be up to the Exchange administrator to implement it.
I would suggest instead that you review the available solutions at http://www.outlookcode.com/article.aspx?ID=52 and decide which one is most appropriate for your version of Outlook and the type of code or application that you are writing. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "SAm" <(E-Mail Removed)> wrote in message news:42D0B283-FD92-4AB7-ACB0-(E-Mail Removed)... > thanks for your quick response. can you please explain what i should do with > this link. i already have seen it but i still don't know what i should do, > what i should instal, and what will work for office 2003. sorry i am not so > familiar with this. > > thanks, > > sam > > "J Blessing" wrote: > >> http://www.slipstick.com/outlook/esecup.htm >> >> >> "SAm" <(E-Mail Removed)> wrote in message >> news:B8AB433E-6188-4E53-BE3D-(E-Mail Removed)... >> > Hi >> > >> > I have been on these boards the last few days try to learn how to do this, >> > but i am unable. >> > >> > i have successfully adapted code (thanks to the MSDN) that does exactly >> > what >> > i need, e.g. send an email from microsoft access. however i get all these >> > warnings messages and i would like to get rid of them. i read up a lot of >> > postings on MSDN but i have no answers. plesae let me know what i can do >> > about it. i will post my code so that you can see what i am doing. btw, i >> > am >> > also getting some message "type mismatch" which i can't figure out where >> > it >> > comes from. >> > >> > here is my code. (its on a form as a seperate subroutine) >> > Sub sbSendMessage(Optional AttachmentPath) >> > On Error GoTo Err_ErrorMsgs >> > >> > Dim objOutlook As Outlook.Application >> > Dim objOutlookMsg As Outlook.MailItem >> > Dim objOutlookRecip As Outlook.Recipient >> > Dim objOutlookAttach As Outlook.Attachment >> > >> > ' Create the Outlook session. >> > Set objOutlook = CreateObject("Outlook.Application") >> > ' Create the message. >> > Set objOutlookMsg = objOutlook.CreateItem(olMailItem) >> > With objOutlookMsg >> > ' Add the To recipient(s) to the message. Substitute >> > ' your names here. >> > Set objOutlookRecip = .Recipients.Add(Me.txtEmailAddress) >> > objOutlookRecip.Type = olTo >> > ' Add the CC recipient(s) to the message. >> > Set objOutlookRecip = .Recipients.Add("(E-Mail Removed)") >> > objOutlookRecip.Type = olCC >> > ' Set the Subject, Body, and Importance of the message. >> > .Subject = Me.txtFacility.Column(0) & " Systems Audit " & Date >> > .Body = Me.txtEmailBodyText >> > ' Add attachments to the message. >> > If Not IsMissing(AttachmentPath) Then >> > Set objOutlookAttach = .Attachments.Add(AttachmentPath) >> > End If >> > ' Resolve each Recipient's name. >> > 'For Each objOutlookRecip In .Recipients >> > 'If Not objOutlookRecip.Resolve Then >> > 'objOutlookMsg.Display >> > 'End If >> > 'Next >> > .Display >> > '.Send >> > End With >> > Set objOutlookMsg = Nothing >> > Set objOutlook = Nothing >> > Set objOutlookRecip = Nothing >> > Set objOutlookAttach = Nothing >> > Err_ErrorMsgs: >> > If Err.Number = "287" Then >> > MsgBox "You clicked No to the Outlook security warning. " & _ >> > " Rerun the procedure and click Yes to access e-mail" & _ >> > " addresses to send your message. For more information," & _ >> > " see the document at http://www.microsoft.com/office" & _ >> > "/previous/outlook/downloads/security.asp. " >> > Else >> > MsgBox Err.Number, Err.Description >> > End If >> > End Sub >> > >> > thanks, >> > >> > sam >> >> >> |
|
||
|
||||
|
=?Utf-8?B?U0Ft?=
Guest
Posts: n/a
|
Thank a lot. i am using now CDO. i got it to work in no time, i have only one
issue. i am trying allow the user to view the email before it is sent out. is this possible? thanks, Sam "Sue Mosher [MVP-Outlook]" wrote: > John's solution applies only if you use Exchange for mail, have a cooperative Exchange administrator, and are willing to sacrifice some security for the sake of your application. It would be up to the Exchange administrator to implement it. > > I would suggest instead that you review the available solutions at http://www.outlookcode.com/article.aspx?ID=52 and decide which one is most appropriate for your version of Outlook and the type of code or application that you are writing. > > -- > Sue Mosher, Outlook MVP > Author of Microsoft Outlook 2007 Programming: > Jumpstart for Power Users and Administrators > http://www.outlookcode.com/article.aspx?id=54 > > > "SAm" <(E-Mail Removed)> wrote in message news:42D0B283-FD92-4AB7-ACB0-(E-Mail Removed)... > > thanks for your quick response. can you please explain what i should do with > > this link. i already have seen it but i still don't know what i should do, > > what i should instal, and what will work for office 2003. sorry i am not so > > familiar with this. > > > > thanks, > > > > sam > > > > "J Blessing" wrote: > > > >> http://www.slipstick.com/outlook/esecup.htm > >> > > >> > >> "SAm" <(E-Mail Removed)> wrote in message > >> news:B8AB433E-6188-4E53-BE3D-(E-Mail Removed)... > >> > Hi > >> > > >> > I have been on these boards the last few days try to learn how to do this, > >> > but i am unable. > >> > > >> > i have successfully adapted code (thanks to the MSDN) that does exactly > >> > what > >> > i need, e.g. send an email from microsoft access. however i get all these > >> > warnings messages and i would like to get rid of them. i read up a lot of > >> > postings on MSDN but i have no answers. plesae let me know what i can do > >> > about it. i will post my code so that you can see what i am doing. btw, i > >> > am > >> > also getting some message "type mismatch" which i can't figure out where > >> > it > >> > comes from. > >> > > >> > here is my code. (its on a form as a seperate subroutine) > >> > Sub sbSendMessage(Optional AttachmentPath) > >> > On Error GoTo Err_ErrorMsgs > >> > > >> > Dim objOutlook As Outlook.Application > >> > Dim objOutlookMsg As Outlook.MailItem > >> > Dim objOutlookRecip As Outlook.Recipient > >> > Dim objOutlookAttach As Outlook.Attachment > >> > > >> > ' Create the Outlook session. > >> > Set objOutlook = CreateObject("Outlook.Application") > >> > ' Create the message. > >> > Set objOutlookMsg = objOutlook.CreateItem(olMailItem) > >> > With objOutlookMsg > >> > ' Add the To recipient(s) to the message. Substitute > >> > ' your names here. > >> > Set objOutlookRecip = .Recipients.Add(Me.txtEmailAddress) > >> > objOutlookRecip.Type = olTo > >> > ' Add the CC recipient(s) to the message. > >> > Set objOutlookRecip = .Recipients.Add("(E-Mail Removed)") > >> > objOutlookRecip.Type = olCC > >> > ' Set the Subject, Body, and Importance of the message. > >> > .Subject = Me.txtFacility.Column(0) & " Systems Audit " & Date > >> > .Body = Me.txtEmailBodyText > >> > ' Add attachments to the message. > >> > If Not IsMissing(AttachmentPath) Then > >> > Set objOutlookAttach = .Attachments.Add(AttachmentPath) > >> > End If > >> > ' Resolve each Recipient's name. > >> > 'For Each objOutlookRecip In .Recipients > >> > 'If Not objOutlookRecip.Resolve Then > >> > 'objOutlookMsg.Display > >> > 'End If > >> > 'Next > >> > .Display > >> > '.Send > >> > End With > >> > Set objOutlookMsg = Nothing > >> > Set objOutlook = Nothing > >> > Set objOutlookRecip = Nothing > >> > Set objOutlookAttach = Nothing > >> > Err_ErrorMsgs: > >> > If Err.Number = "287" Then > >> > MsgBox "You clicked No to the Outlook security warning. " & _ > >> > " Rerun the procedure and click Yes to access e-mail" & _ > >> > " addresses to send your message. For more information," & _ > >> > " see the document at http://www.microsoft.com/office" & _ > >> > "/previous/outlook/downloads/security.asp. " > >> > Else > >> > MsgBox Err.Number, Err.Description > >> > End If > >> > End Sub > >> > > >> > thanks, > >> > > >> > sam > >> > >> > >> > |
|
||
|
||||
|
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
|
That depends on which CDO you're using. If it's CDO for Windows, I think not, unless you provide your own UI.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "SAm" <(E-Mail Removed)> wrote in message news:262AEAF5-18AD-44DE-864A-(E-Mail Removed)... > Thank a lot. i am using now CDO. i got it to work in no time, i have only one > issue. i am trying allow the user to view the email before it is sent out. is > this possible? > > thanks, > > Sam > > "Sue Mosher [MVP-Outlook]" wrote: > >> John's solution applies only if you use Exchange for mail, have a cooperative Exchange administrator, and are willing to sacrifice some security for the sake of your application. It would be up to the Exchange administrator to implement it. >> >> I would suggest instead that you review the available solutions at http://www.outlookcode.com/article.aspx?ID=52 and decide which one is most appropriate for your version of Outlook and the type of code or application that you are writing. >> >> "SAm" <(E-Mail Removed)> wrote in message news:42D0B283-FD92-4AB7-ACB0-(E-Mail Removed)... >> > thanks for your quick response. can you please explain what i should do with >> > this link. i already have seen it but i still don't know what i should do, >> > what i should instal, and what will work for office 2003. sorry i am not so >> > familiar with this. >> > >> > thanks, >> > >> > sam >> > >> > "J Blessing" wrote: >> > >> >> http://www.slipstick.com/outlook/esecup.htm >> >> >> >> >> >> >> "SAm" <(E-Mail Removed)> wrote in message >> >> news:B8AB433E-6188-4E53-BE3D-(E-Mail Removed)... >> >> > Hi >> >> > >> >> > I have been on these boards the last few days try to learn how to do this, >> >> > but i am unable. >> >> > >> >> > i have successfully adapted code (thanks to the MSDN) that does exactly >> >> > what >> >> > i need, e.g. send an email from microsoft access. however i get all these >> >> > warnings messages and i would like to get rid of them. i read up a lot of >> >> > postings on MSDN but i have no answers. plesae let me know what i can do >> >> > about it. i will post my code so that you can see what i am doing. btw, i >> >> > am >> >> > also getting some message "type mismatch" which i can't figure out where >> >> > it >> >> > comes from. >> >> > >> >> > here is my code. (its on a form as a seperate subroutine) >> >> > Sub sbSendMessage(Optional AttachmentPath) >> >> > On Error GoTo Err_ErrorMsgs >> >> > >> >> > Dim objOutlook As Outlook.Application >> >> > Dim objOutlookMsg As Outlook.MailItem >> >> > Dim objOutlookRecip As Outlook.Recipient >> >> > Dim objOutlookAttach As Outlook.Attachment >> >> > >> >> > ' Create the Outlook session. >> >> > Set objOutlook = CreateObject("Outlook.Application") >> >> > ' Create the message. >> >> > Set objOutlookMsg = objOutlook.CreateItem(olMailItem) >> >> > With objOutlookMsg >> >> > ' Add the To recipient(s) to the message. Substitute >> >> > ' your names here. >> >> > Set objOutlookRecip = .Recipients.Add(Me.txtEmailAddress) >> >> > objOutlookRecip.Type = olTo >> >> > ' Add the CC recipient(s) to the message. >> >> > Set objOutlookRecip = .Recipients.Add("(E-Mail Removed)") >> >> > objOutlookRecip.Type = olCC >> >> > ' Set the Subject, Body, and Importance of the message. >> >> > .Subject = Me.txtFacility.Column(0) & " Systems Audit " & Date >> >> > .Body = Me.txtEmailBodyText >> >> > ' Add attachments to the message. >> >> > If Not IsMissing(AttachmentPath) Then >> >> > Set objOutlookAttach = ..Attachments.Add(AttachmentPath) >> >> > End If >> >> > ' Resolve each Recipient's name. >> >> > 'For Each objOutlookRecip In .Recipients >> >> > 'If Not objOutlookRecip.Resolve Then >> >> > 'objOutlookMsg.Display >> >> > 'End If >> >> > 'Next >> >> > .Display >> >> > '.Send >> >> > End With >> >> > Set objOutlookMsg = Nothing >> >> > Set objOutlook = Nothing >> >> > Set objOutlookRecip = Nothing >> >> > Set objOutlookAttach = Nothing >> >> > Err_ErrorMsgs: >> >> > If Err.Number = "287" Then >> >> > MsgBox "You clicked No to the Outlook security warning. " & _ >> >> > " Rerun the procedure and click Yes to access e-mail" & _ >> >> > " addresses to send your message. For more information," & _ >> >> > " see the document at http://www.microsoft.com/office" & _ >> >> > "/previous/outlook/downloads/security.asp. " >> >> > Else >> >> > MsgBox Err.Number, Err.Description >> >> > End If >> >> > End Sub >> >> > >> >> > thanks, >> >> > >> >> > sam >> >> >> >> >> >> >> |
|
||
|
||||
|
=?Utf-8?B?U0Ft?=
Guest
Posts: n/a
|
Hi Sue,
Thanks for all your replies, i really appreciate it. ok, i now know of 3 methods to send email from access. 1. docmd.sendobject 2. automate using access 3. cdo windows none of these seem to be optimal. 1. doesn't have enough options (attahcments) 2. has too many error messages to which i have not seen any solution. 3. i will probably be able to figure out the signature part (i'll send html in the body), but i am still struggling having all computers be able to send. for some reason some computers are having problems. i am working with my admin to resolve this. as far as the UI, not sure what you mean i should have my own UI. i think for the most part i don't need to see the message before it leaves, but it would be nice to have that option available. i was told that its impossible. please help me with any input you might have. is there another method which i should explore? also, i would love to automate, i am very succesful with Word and Excel. i would love to have a full functioning outlook. just don't know how to get rid of the errors. (i saw there is a .dll file, but thats complicated, and i don't know if it works in oulook with out exchange. thanks, sam "Sue Mosher [MVP-Outlook]" wrote: > See http://www.outlookcode.com/article.aspx?ID=52 for your options with regard to the "object model guard" security in Outlook 2000 SP2 and later versions. > > -- > Sue Mosher, Outlook MVP > Author of Microsoft Outlook 2007 Programming: > Jumpstart for Power Users and Administrators > http://www.outlookcode.com/article.aspx?id=54 > > > "SAm" <(E-Mail Removed)> wrote in message news:B8AB433E-6188-4E53-BE3D-(E-Mail Removed)... > > Hi > > > > I have been on these boards the last few days try to learn how to do this, > > but i am unable. > > > > i have successfully adapted code (thanks to the MSDN) that does exactly what > > i need, e.g. send an email from microsoft access. however i get all these > > warnings messages and i would like to get rid of them. i read up a lot of > > postings on MSDN but i have no answers. plesae let me know what i can do > > about it. i will post my code so that you can see what i am doing. btw, i am > > also getting some message "type mismatch" which i can't figure out where it > > comes from. > > > > here is my code. (its on a form as a seperate subroutine) > > Sub sbSendMessage(Optional AttachmentPath) > > On Error GoTo Err_ErrorMsgs > > > > Dim objOutlook As Outlook.Application > > Dim objOutlookMsg As Outlook.MailItem > > Dim objOutlookRecip As Outlook.Recipient > > Dim objOutlookAttach As Outlook.Attachment > > > > ' Create the Outlook session. > > Set objOutlook = CreateObject("Outlook.Application") > > ' Create the message. > > Set objOutlookMsg = objOutlook.CreateItem(olMailItem) > > With objOutlookMsg > > ' Add the To recipient(s) to the message. Substitute > > ' your names here. > > Set objOutlookRecip = .Recipients.Add(Me.txtEmailAddress) > > objOutlookRecip.Type = olTo > > ' Add the CC recipient(s) to the message. > > Set objOutlookRecip = .Recipients.Add("(E-Mail Removed)") > > objOutlookRecip.Type = olCC > > ' Set the Subject, Body, and Importance of the message. > > .Subject = Me.txtFacility.Column(0) & " Systems Audit " & Date > > .Body = Me.txtEmailBodyText > > ' Add attachments to the message. > > If Not IsMissing(AttachmentPath) Then > > Set objOutlookAttach = .Attachments.Add(AttachmentPath) > > End If > > ' Resolve each Recipient's name. > > 'For Each objOutlookRecip In .Recipients > > 'If Not objOutlookRecip.Resolve Then > > 'objOutlookMsg.Display > > 'End If > > 'Next > > .Display > > '.Send > > End With > > Set objOutlookMsg = Nothing > > Set objOutlook = Nothing > > Set objOutlookRecip = Nothing > > Set objOutlookAttach = Nothing > > Err_ErrorMsgs: > > If Err.Number = "287" Then > > MsgBox "You clicked No to the Outlook security warning. " & _ > > " Rerun the procedure and click Yes to access e-mail" & _ > > " addresses to send your message. For more information," & _ > > " see the document at http://www.microsoft.com/office" & _ > > "/previous/outlook/downloads/security.asp. " > > Else > > MsgBox Err.Number, Err.Description > > End If > > End Sub > > > > thanks, > > > > sam > |
|
||
|
||||
|
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
|
If it were my project, I'd use Outlook automation, as in your code below, + Outlook Redemption (see the URL I posted earlier) to handle the security prompts. You can also use Outlook objects, without resolving recipients, and display the message instead of sending it
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "SAm" <(E-Mail Removed)> wrote in message news:A22513DD-C89F-491A-B4B1-(E-Mail Removed)... > Hi Sue, > > Thanks for all your replies, i really appreciate it. ok, i now know of 3 > methods to send email from access. > 1. docmd.sendobject > 2. automate using access > 3. cdo windows > > none of these seem to be optimal. > 1. doesn't have enough options (attahcments) > 2. has too many error messages to which i have not seen any solution. > 3. i will probably be able to figure out the signature part (i'll send html > in the body), but i am still struggling having all computers be able to send. > for some reason some computers are having problems. i am working with my > admin to resolve this. as far as the UI, not sure what you mean i should have > my own UI. i think for the most part i don't need to see the message before > it leaves, but it would be nice to have that option available. i was told > that its impossible. > > please help me with any input you might have. is there another method which > i should explore? also, i would love to automate, i am very succesful with > Word and Excel. i would love to have a full functioning outlook. just don't > know how to get rid of the errors. (i saw there is a .dll file, but thats > complicated, and i don't know if it works in oulook with out exchange. > > thanks, > > sam > > "Sue Mosher [MVP-Outlook]" wrote: > >> See http://www.outlookcode.com/article.aspx?ID=52 for your options with regard to the "object model guard" security in Outlook 2000 SP2 and later versions. >> >> "SAm" <(E-Mail Removed)> wrote in message news:B8AB433E-6188-4E53-BE3D-(E-Mail Removed)... >> > Hi >> > >> > I have been on these boards the last few days try to learn how to do this, >> > but i am unable. >> > >> > i have successfully adapted code (thanks to the MSDN) that does exactly what >> > i need, e.g. send an email from microsoft access. however i get all these >> > warnings messages and i would like to get rid of them. i read up a lot of >> > postings on MSDN but i have no answers. plesae let me know what i can do >> > about it. i will post my code so that you can see what i am doing. btw, i am >> > also getting some message "type mismatch" which i can't figure out where it >> > comes from. >> > >> > here is my code. (its on a form as a seperate subroutine) >> > Sub sbSendMessage(Optional AttachmentPath) >> > On Error GoTo Err_ErrorMsgs >> > >> > Dim objOutlook As Outlook.Application >> > Dim objOutlookMsg As Outlook.MailItem >> > Dim objOutlookRecip As Outlook.Recipient >> > Dim objOutlookAttach As Outlook.Attachment >> > >> > ' Create the Outlook session. >> > Set objOutlook = CreateObject("Outlook.Application") >> > ' Create the message. >> > Set objOutlookMsg = objOutlook.CreateItem(olMailItem) >> > With objOutlookMsg >> > ' Add the To recipient(s) to the message. Substitute >> > ' your names here. >> > Set objOutlookRecip = .Recipients.Add(Me.txtEmailAddress) >> > objOutlookRecip.Type = olTo >> > ' Add the CC recipient(s) to the message. >> > Set objOutlookRecip = .Recipients.Add("(E-Mail Removed)") >> > objOutlookRecip.Type = olCC >> > ' Set the Subject, Body, and Importance of the message. >> > .Subject = Me.txtFacility.Column(0) & " Systems Audit " & Date >> > .Body = Me.txtEmailBodyText >> > ' Add attachments to the message. >> > If Not IsMissing(AttachmentPath) Then >> > Set objOutlookAttach = .Attachments.Add(AttachmentPath) >> > End If >> > ' Resolve each Recipient's name. >> > 'For Each objOutlookRecip In .Recipients >> > 'If Not objOutlookRecip.Resolve Then >> > 'objOutlookMsg.Display >> > 'End If >> > 'Next >> > .Display >> > '.Send >> > End With >> > Set objOutlookMsg = Nothing >> > Set objOutlook = Nothing >> > Set objOutlookRecip = Nothing >> > Set objOutlookAttach = Nothing >> > Err_ErrorMsgs: >> > If Err.Number = "287" Then >> > MsgBox "You clicked No to the Outlook security warning. " & _ >> > " Rerun the procedure and click Yes to access e-mail" & _ >> > " addresses to send your message. For more information," & _ >> > " see the document at http://www.microsoft.com/office" & _ >> > "/previous/outlook/downloads/security.asp. " >> > Else >> > MsgBox Err.Number, Err.Description >> > End If >> > End Sub >> > >> > thanks, >> > >> > sam >> |
|
||
|
||||
|
|
|
| |
![]() |
| Thread Tools | |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to Avoid Security Warnings for Our Access Application | Rod Wright | Windows Vista Security | 2 | 22nd Apr 2008 05:03 PM |
| How to avoid Security PopUp in Outlook 2003 | Greg | Microsoft Outlook Discussion | 1 | 17th Aug 2006 04:30 PM |
| Trouble viewing messages in Outlook 2003, possible security issue | keplerteresa@hotmail.com | Microsoft Outlook | 1 | 12th Apr 2006 09:37 PM |
| how can we avoid security popup in Outlook 2003? | =?Utf-8?B?TmFkZWVt?= | Microsoft Outlook VBA Programming | 6 | 12th Nov 2005 12:23 PM |
| Automating multiple signatures on new messages in Outlook 2003 | David | Microsoft Outlook | 1 | 24th Jan 2004 05:12 AM |
Powered by vBulletin®. Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2010, Crawlability, Inc. |




