Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / General MS Outlook Questions / July 2007

Tip: Looking for answers? Try searching our database.

avoid security messages when automating outlook using access 2003

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SAm - 27 Jul 2007 16:50 GMT
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("sam@sam.com")
     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] - 27 Jul 2007 17:03 GMT
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.

Signature

Sue Mosher, Outlook MVP
  Author of Microsoft Outlook 2007 Programming:
    Jumpstart for Power Users and Administrators
   http://www.outlookcode.com/article.aspx?id=54

> Hi
>
[quoted text clipped - 65 lines]
>
> sam
SAm - 31 Jul 2007 22:38 GMT
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

> 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.
>
[quoted text clipped - 67 lines]
> >
> > sam
Sue Mosher [MVP-Outlook] - 31 Jul 2007 23:42 GMT
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

Signature

Sue Mosher, Outlook MVP
  Author of Microsoft Outlook 2007 Programming:
    Jumpstart for Power Users and Administrators
   http://www.outlookcode.com/article.aspx?id=54

> Hi Sue,
>
[quoted text clipped - 96 lines]
>> >
>> > sam
J Blessing - 27 Jul 2007 17:14 GMT
http://www.slipstick.com/outlook/esecup.htm

Signature

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

> Hi
>
[quoted text clipped - 68 lines]
>
> sam
SAm - 27 Jul 2007 17:44 GMT
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

> http://www.slipstick.com/outlook/esecup.htm
>
[quoted text clipped - 70 lines]
> >
> > sam
Sue Mosher [MVP-Outlook] - 27 Jul 2007 17:49 GMT
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.

Signature

Sue Mosher, Outlook MVP
  Author of Microsoft Outlook 2007 Programming:
    Jumpstart for Power Users and Administrators
   http://www.outlookcode.com/article.aspx?id=54

> 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,
[quoted text clipped - 6 lines]
>
>> http://www.slipstick.com/outlook/esecup.htm

>> > Hi
>> >
[quoted text clipped - 68 lines]
>> >
>> > sam
SAm - 30 Jul 2007 21:18 GMT
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

> 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.
>
[quoted text clipped - 83 lines]
> >> >
> >> > sam
Sue Mosher [MVP-Outlook] - 30 Jul 2007 23:47 GMT
That depends on which CDO you're using. If it's CDO for Windows, I think not, unless you provide your own UI.

Signature

Sue Mosher, Outlook MVP
  Author of Microsoft Outlook 2007 Programming:
    Jumpstart for Power Users and Administrators
   http://www.outlookcode.com/article.aspx?id=54

> 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
[quoted text clipped - 7 lines]
>>
>> 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.

>> > 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,
[quoted text clipped - 79 lines]
>> >> >
>> >> > sam
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.