Sign in to follow this  
Followers 0
wjans

COM question

3 posts in this topic

I'm trying to disable an outlook warning when trying to sent out an automated email. For each message outlook (2003) warns about 'an external program trying to send ...)

In the example Delphi code this was done via :

CODE
OlSecurityManager.ConnectTo(outlookApp);

OlSecurityManager.DisableOOMWarnings := True;

try

//... any action with protected objects ...

finally

OlSecurityManager.DisableOOMWarnings = False;

end;

I can't figure out how to do the .ConnectTo thing in AutoIt. Don't know much about COM either.

This is what i came up with so far ... Any ideas ?

Thanks in advance.

ProcessWaitClose("PDFSpooler.exe")
    sleep(2000)
    ;create mail via outlook object
    $outlook = ObjCreate("Outlook.Application")
    [i]$outlooksec = ObjCreate("OlSecurityManager")
    $outlooksecdis = ObjCreate("OlSecurityManager.DisableOOMWarnings")
    $outlooksec.ConnectTo $outlook 
    $outlooksecdis = True [/i]
    $objMail = $Outlook.Application.CreateItem(0)
    $objMail.Recipients.add($email)
    $objMail.Subject = $mailsubject
    $objMail.HTMLBody = $mailbody
    $objMail.attachments.add("c:\licenceautomation\report.pdf")
    $objMail.Display

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I've never tried to Disable SecurityManager but try this...

$outlook = ObjCreate("Outlook.Application")

$outlooksec = ObjCreate("OlSecurityManager")

With $outlooksec ; Create a Pool

.DisableOOMWarnings = True

.ConnectTo($outlook)

EndWith

$outlooksecdis = True ; I don't know where this is attached...

$objMail = $Outlook.Application.CreateItem(0) ; Looks alright to me

$objMail.Recipients.add($email)

$objMail.Subject = $mailsubject

$objMail.HTMLBody = $mailbody

$objMail.attachments.add("c:\licenceautomation\report.pdf")

$objMail.Display

I don't know if this can help you in some manners but you just has to fool around and look into VB scripts as these can be ported into autoit3 com support almost without any changes...

kjative

Edited by kjactive

Share this post


Link to post
Share on other sites

I've never tried to Disable SecurityManager but try this...

$outlook = ObjCreate("Outlook.Application")

$outlooksec = ObjCreate("OlSecurityManager")

With $outlooksec ; Create a Pool

.DisableOOMWarnings = True

.ConnectTo($outlook)

EndWith

$outlooksecdis = True ; I don't know where this is attached...

$objMail = $Outlook.Application.CreateItem(0) ; Looks alright to me

$objMail.Recipients.add($email)

$objMail.Subject = $mailsubject

$objMail.HTMLBody = $mailbody

$objMail.attachments.add("c:\licenceautomation\report.pdf")

$objMail.Display

I don't know if this can help you in some manners but you just has to fool around and look into VB scripts as these can be ported into autoit3 com support almost without any changes...

kjative

Disabling Outlook Security warning is only possible with an external programm or with redemption.dll adress http://www.dimastar>com or try a research on Google with redemption.dll like word

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0