Jump to content



Photo

OutlookEX UDF - Help & Support


  • This topic is locked This topic is locked
634 replies to this topic

#1 water

water

    ?

  • MVPs
  • 10,614 posts

Posted 09 March 2011 - 07:03 PM

This is the "General Help and Support" thread for the Extended Outlook UDF (OutlookEX).
The UDF itself can be downloaded here (please see my signature below).

So if you have any questions, suggestions or errors please post here.

Edited by water, 31 May 2011 - 05:30 AM.

UDFs:

Active Directory (2012-10-12 - Version 1.3.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

OutlookEX (2012-10-07 - Version 0.9.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

ExcelChart (2013-01-21 - Version 0.3.1.1 released) - Download - General Help & Support - Example Scripts

WordEX (2012-12-29 - Version 1.3 released) - Download

ExcelEX (2013-05-11 - Alpha 4 released) - Download






#2 Syed23

Syed23

    Mass Spammer! - It's Me

  • Active Members
  • PipPipPipPipPipPip
  • 519 posts

Posted 18 March 2011 - 01:11 PM

Hi Water,

I am trying to send an email to particular ID by using "Outlook.au3" - _outlooksendemail() function. But i am ending up with an error message Error occured during the "Objevent". The error value returns as "9". Do you have any suggestion for me please ?
Thank you,Regards,K.Syed Ibrahim.

#3 water

water

    ?

  • MVPs
  • 10,614 posts

Posted 18 March 2011 - 01:17 PM

Hi Syed,

Did you call _OutlookOpen() as first statement?
Is Outlook installed on the machine?

Edited by water, 18 March 2011 - 01:18 PM.

UDFs:

Active Directory (2012-10-12 - Version 1.3.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

OutlookEX (2012-10-07 - Version 0.9.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

ExcelChart (2013-01-21 - Version 0.3.1.1 released) - Download - General Help & Support - Example Scripts

WordEX (2012-12-29 - Version 1.3 released) - Download

ExcelEX (2013-05-11 - Alpha 4 released) - Download


#4 Syed23

Syed23

    Mass Spammer! - It's Me

  • Active Members
  • PipPipPipPipPipPip
  • 519 posts

Posted 18 March 2011 - 01:37 PM

Hi Syed,

Did you call _OutlookOpen() as first statement?
Is Outlook installed on the machine?



yeah.. I do water. Please see the below code! Also Outlook is present on that machine, Office 2007.

#include<Outlook.au3>
#include<File.au3>
$ooutlook = _OutlookOpen()

_OutlookSendMail($oOutlook, "winningmoment_syed@yahoo.co.in","","", "GD Core Application Checker tool Feedback", $TextBody,$attachemnt,"Tahoma")
If @error Then
_FileWriteLog(@DesktopDir&"\outlook.log","Error > Mail Process >"&"Uanble to send an email.Error occured during the mail process.Error value is "&@error)
MsgBox(64,"Error Message","Error Occured while sending an email")
EndIf
Thank you,Regards,K.Syed Ibrahim.

#5 water

water

    ?

  • MVPs
  • 10,614 posts

Posted 18 March 2011 - 01:42 PM

Please replace the last parameter of _OutlookSendMail. "Tahoma" is no an valid entry.
You can just use $olFormatHTML, $olFormatPlain, $olFormatRichText, $olFormatUnspecified to specify the format of the body.

Edit:
Or if you like you can use OutlookEX, the successor of the Outlook UDF.
OutlookEX has more functions, better error handling ...

We have even written "wrapper" functions so migration from Outlook to OutlookEX is much easier.
If you like I can post the code.

Edited by water, 18 March 2011 - 01:46 PM.

UDFs:

Active Directory (2012-10-12 - Version 1.3.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

OutlookEX (2012-10-07 - Version 0.9.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

ExcelChart (2013-01-21 - Version 0.3.1.1 released) - Download - General Help & Support - Example Scripts

WordEX (2012-12-29 - Version 1.3 released) - Download

ExcelEX (2013-05-11 - Alpha 4 released) - Download


#6 Syed23

Syed23

    Mass Spammer! - It's Me

  • Active Members
  • PipPipPipPipPipPip
  • 519 posts

Posted 18 March 2011 - 01:44 PM

Please replace the last parameter of _OutlookSendMail. "Tahoma" is no an valid entry.
You can just use $olFormatHTML, $olFormatPlain, $olFormatRichText, $olFormatUnspecified to specify the format of the body.



even i tried with the below code! still the result same! :)

#include<Outlook.au3>
#include<File.au3>
$ooutlook = _OutlookOpen()

_OutlookSendMail($oOutlook, "winningmoment_syed@yahoo.co.in","","", "GD Core Application Checker tool Feedback", $TextBody,$attachemnt)
If @error Then
_FileWriteLog(@DesktopDir&"\outlook.log","Error > Mail Process >"&"Uanble to send an email.Error occured during the mail process.Error value is "&@error)
MsgBox(64,"Error Message","Error Occured while sending an email")
EndIf
Thank you,Regards,K.Syed Ibrahim.

#7 water

water

    ?

  • MVPs
  • 10,614 posts

Posted 18 March 2011 - 01:47 PM

Isn't there a typo in "$attachemnt"? Shouldn't it read "$attachment"?

BTW: There is an enhanced Outlook UDF available - please see my previous post.

Edited by water, 18 March 2011 - 01:50 PM.

UDFs:

Active Directory (2012-10-12 - Version 1.3.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

OutlookEX (2012-10-07 - Version 0.9.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

ExcelChart (2013-01-21 - Version 0.3.1.1 released) - Download - General Help & Support - Example Scripts

WordEX (2012-12-29 - Version 1.3 released) - Download

ExcelEX (2013-05-11 - Alpha 4 released) - Download


#8 Syed23

Syed23

    Mass Spammer! - It's Me

  • Active Members
  • PipPipPipPipPipPip
  • 519 posts

Posted 18 March 2011 - 01:52 PM

Isn't there a type in "$attachemnt"? Shouldn't it read "$attachment"?

BTW: There is an enhanced Outlook UDF available - please see my previous post.


for the varible $attachemnt i have declared properly. Please see the below 2 two options what i have tried. But the result where same :). sorry for this late reply


#include <OutlookEX.au3>

Global $oOutlook = _OL_Open()

; *****************************************************************************
; Example 1
; Send an html mail to the current user.
; Add an attachment and set importance to high.
; *****************************************************************************
Global $sCurrentUser = $oOutlook.GetNameSpace("MAPI").CurrentUser.Name
_OL_MailSend($oOutlook, "TestSubject", "Body<br><b>fett</b> normal.", $sCurrentUser, @ScriptDir & "\_OL_MailSend.au3", $olImportanceHigh, $olFormatHTML)
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_MailSend Example Script", "Error sending mail. @error = " & @error & ", @extended: " & @extended)
MsgBox(64, "OutlookEX UDF: _OL_MailSend Example Script", "Mail successfully sent to user '" & $sCurrentUser & "'!")


; *****************************************************************************
; Example 2
; *****************************************************************************


#include<Outlook.au3>
#include<File.au3>
$attachemnt = "C:\temp\report.html"
$TextBody = "does it works without any issue?"
$oOutlook= _OutlookOpen()

_OutlookSendMail($oOutlook, "winningmoment_syed@yahoo.co.in","","", "GD Core Application Checker tool Feedback", $TextBody,$attachemnt)
If @error Then
_FileWriteLog(@DesktopDir&"\outlook.log","Error > Mail Process >"&"Uanble to send an email.Error occured during the mail process.Error value is "&@error)
MsgBox(64,"Error Message","Error Occured while sending an email")
EndIf
Thank you,Regards,K.Syed Ibrahim.

#9 water

water

    ?

  • MVPs
  • 10,614 posts

Posted 18 March 2011 - 01:58 PM

Could you please run the following script? I inserted one line (denoted by <==) which should give us better error messages. Could you please post the pop up you get?
#include <OutlookEX.au3> Global $oOutlook = _OL_Open() $iOL_Debug = 2  ; <== Insert this line ; ***************************************************************************** ; Example 1 ; Send an html mail to the current user. ; Add an attachment and set importance to high. ; ***************************************************************************** Global $sCurrentUser = $oOutlook.GetNameSpace("MAPI").CurrentUser.Name _OL_MailSend($oOutlook, "TestSubject", "Body<br><b>fett</b> normal.", $sCurrentUser, @ScriptDir & "\_OL_MailSend.au3", $olImportanceHigh, $olFormatHTML) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_MailSend Example Script", "Error sending mail. @error = " & @error & ", @extended: " & @extended) MsgBox(64, "OutlookEX UDF: _OL_MailSend Example Script", "Mail successfully sent to user '" & $sCurrentUser & "'!")

UDFs:

Active Directory (2012-10-12 - Version 1.3.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

OutlookEX (2012-10-07 - Version 0.9.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

ExcelChart (2013-01-21 - Version 0.3.1.1 released) - Download - General Help & Support - Example Scripts

WordEX (2012-12-29 - Version 1.3 released) - Download

ExcelEX (2013-05-11 - Alpha 4 released) - Download


#10 Syed23

Syed23

    Mass Spammer! - It's Me

  • Active Members
  • PipPipPipPipPipPip
  • 519 posts

Posted 18 March 2011 - 02:03 PM

Could you please run the following script? I inserted one line (denoted by <==) which should give us better error messages. Could you please post the pop up you get?

#include <OutlookEX.au3> Global $oOutlook = _OL_Open() $iOL_Debug = 2     ; <== Insert this line ; ***************************************************************************** ; Example 1 ; Send an html mail to the current user. ; Add an attachment and set importance to high. ; ***************************************************************************** Global $sCurrentUser = $oOutlook.GetNameSpace("MAPI").CurrentUser.Name _OL_MailSend($oOutlook, "TestSubject", "Body<br><b>fett</b> normal.", $sCurrentUser, @ScriptDir & "\_OL_MailSend.au3", $olImportanceHigh, $olFormatHTML) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_MailSend Example Script", "Error sending mail. @error = " & @error & ", @extended: " & @extended) MsgBox(64, "OutlookEX UDF: _OL_MailSend Example Script", "Mail successfully sent to user '" & $sCurrentUser & "'!")

yeah..i gave a try and got below message!
Thank you,Regards,K.Syed Ibrahim.

#11 water

water

    ?

  • MVPs
  • 10,614 posts

Posted 18 March 2011 - 02:20 PM

Mmmm ... "operation aborted" can be everything.

What operating system do you run?
What version of Outlook do you use?

UDFs:

Active Directory (2012-10-12 - Version 1.3.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

OutlookEX (2012-10-07 - Version 0.9.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

ExcelChart (2013-01-21 - Version 0.3.1.1 released) - Download - General Help & Support - Example Scripts

WordEX (2012-12-29 - Version 1.3 released) - Download

ExcelEX (2013-05-11 - Alpha 4 released) - Download


#12 water

water

    ?

  • MVPs
  • 10,614 posts

Posted 18 March 2011 - 02:23 PM

Scriptline 10 seems to be the line before _OL_MailSend.
Could you please run this - modified - version? We try to catch the error as soon as possible.
#include <OutlookEX.au3> $iOL_Debug = 2  ; <==This line has been moved Global $oOutlook = _OL_Open() ; ***************************************************************************** ; Example 1 ; Send an html mail to the current user. ; Add an attachment and set importance to high. ; ***************************************************************************** Global $sCurrentUser = $oOutlook.GetNameSpace("MAPI").CurrentUser.Name _OL_MailSend($oOutlook, "TestSubject", "Body<br><b>fett</b> normal.", $sCurrentUser, @ScriptDir & "\_OL_MailSend.au3", $olImportanceHigh, $olFormatHTML) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_MailSend Example Script", "Error sending mail. @error = " & @error & ", @extended: " & @extended) MsgBox(64, "OutlookEX UDF: _OL_MailSend Example Script", "Mail successfully sent to user '" & $sCurrentUser & "'!")

Edited by water, 18 March 2011 - 02:24 PM.

UDFs:

Active Directory (2012-10-12 - Version 1.3.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

OutlookEX (2012-10-07 - Version 0.9.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

ExcelChart (2013-01-21 - Version 0.3.1.1 released) - Download - General Help & Support - Example Scripts

WordEX (2012-12-29 - Version 1.3 released) - Download

ExcelEX (2013-05-11 - Alpha 4 released) - Download


#13 Syed23

Syed23

    Mass Spammer! - It's Me

  • Active Members
  • PipPipPipPipPipPip
  • 519 posts

Posted 18 March 2011 - 02:57 PM

Scriptline 10 seems to be the line before _OL_MailSend.
Could you please run this - modified - version? We try to catch the error as soon as possible.

#include <OutlookEX.au3> $iOL_Debug = 2     ; <==This line has been moved Global $oOutlook = _OL_Open() ; ***************************************************************************** ; Example 1 ; Send an html mail to the current user. ; Add an attachment and set importance to high. ; ***************************************************************************** Global $sCurrentUser = $oOutlook.GetNameSpace("MAPI").CurrentUser.Name _OL_MailSend($oOutlook, "TestSubject", "Body<br><b>fett</b> normal.", $sCurrentUser, @ScriptDir & "\_OL_MailSend.au3", $olImportanceHigh, $olFormatHTML) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_MailSend Example Script", "Error sending mail. @error = " & @error & ", @extended: " & @extended) MsgBox(64, "OutlookEX UDF: _OL_MailSend Example Script", "Mail successfully sent to user '" & $sCurrentUser & "'!")

The modified script works fine only if i have opened the outlook during the script execution orelse the below messages are getting prompted.please let me know if i follow anything wrong.

Edited by Syed23, 18 March 2011 - 03:00 PM.

Thank you,Regards,K.Syed Ibrahim.

#14 water

water

    ?

  • MVPs
  • 10,614 posts

Posted 18 March 2011 - 03:32 PM

Same problem here. It runs fine when Outlook is running. But crashes with the same error messages you get if Outlook is not up and running.
I'll have to investigate this problem.

UDFs:

Active Directory (2012-10-12 - Version 1.3.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

OutlookEX (2012-10-07 - Version 0.9.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

ExcelChart (2013-01-21 - Version 0.3.1.1 released) - Download - General Help & Support - Example Scripts

WordEX (2012-12-29 - Version 1.3 released) - Download

ExcelEX (2013-05-11 - Alpha 4 released) - Download


#15 water

water

    ?

  • MVPs
  • 10,614 posts

Posted 19 March 2011 - 11:08 AM

Hi Syed,
I've been searching the internet high and low but couldn't find a solution.
It seems as if ObjCreate starts up Outlook and returns to your script before the COM interface is up and running. It looks as if Outlook does some of the startup asynchroniously.
The only solution I have so far is to put a Sleep(1000) - or more - after _OL_Open().

UDFs:

Active Directory (2012-10-12 - Version 1.3.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

OutlookEX (2012-10-07 - Version 0.9.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

ExcelChart (2013-01-21 - Version 0.3.1.1 released) - Download - General Help & Support - Example Scripts

WordEX (2012-12-29 - Version 1.3 released) - Download

ExcelEX (2013-05-11 - Alpha 4 released) - Download


#16 Syed23

Syed23

    Mass Spammer! - It's Me

  • Active Members
  • PipPipPipPipPipPip
  • 519 posts

Posted 19 March 2011 - 02:05 PM

Hi Syed,
I've been searching the internet high and low but couldn't find a solution.
It seems as if ObjCreate starts up Outlook and returns to your script before the COM interface is up and running. It looks as if Outlook does some of the startup asynchroniously.
The only solution I have so far is to put a Sleep(1000) - or more - after _OL_Open().


hmmm... Thanks for your research on it Water.Currently i am vaccation.Once i get in to work i will test it and let you know the solution.

Note:

On Windows machine i am getting the same error message even if i have opened the outlook during the script execution. Shall i try the same solution on Windows 7 too ?

Anyway Thanks a lot and i will let you know the results!
Thank you,Regards,K.Syed Ibrahim.

#17 water

water

    ?

  • MVPs
  • 10,614 posts

Posted 19 March 2011 - 02:10 PM

Hi Syed,
I've tested on Windows XP SP3 with Outlook 2002 and on Windows 7 SP1 with Outlook 2010.
On both machines Windows 7 with Outlook 2010 it works when Outlook is already running and doesn't if I don't wait for Outlook to come up.

Edit:
On Windows XP SP3 with Outlook 2002 it doesn't matter if Outlook is running or not - _OL_MailSend always works.

Edited by water, 19 March 2011 - 02:26 PM.

UDFs:

Active Directory (2012-10-12 - Version 1.3.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

OutlookEX (2012-10-07 - Version 0.9.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

ExcelChart (2013-01-21 - Version 0.3.1.1 released) - Download - General Help & Support - Example Scripts

WordEX (2012-12-29 - Version 1.3 released) - Download

ExcelEX (2013-05-11 - Alpha 4 released) - Download


#18 water

water

    ?

  • MVPs
  • 10,614 posts

Posted 19 March 2011 - 03:50 PM

Version 0.0.3 has been released.

Please test before using in production!

For download please see my signature.

UDFs:

Active Directory (2012-10-12 - Version 1.3.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

OutlookEX (2012-10-07 - Version 0.9.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

ExcelChart (2013-01-21 - Version 0.3.1.1 released) - Download - General Help & Support - Example Scripts

WordEX (2012-12-29 - Version 1.3 released) - Download

ExcelEX (2013-05-11 - Alpha 4 released) - Download


#19 Autobot

Autobot

    Seeker

  • New Members
  • 3 posts

Posted 21 March 2011 - 07:36 AM

Seems to work well however if I loop the ItemFind function I get this if I don't put timed delay between the commands:

OutlookEX.au3 (1831) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
$aOL_Items[$iOL_Counter][$iOL_Index - 1] = $oOL_Item.ItemProperties.Item($aOL_ReturnProperties[$iOL_Index] ).value
^ ERROR

Works fine if I pause for a couple of seconds after each call.

Any ideas? Since I don't directly see a flaw in your code to cause it.

#20 water

water

    ?

  • MVPs
  • 10,614 posts

Posted 21 March 2011 - 07:44 AM

Hi Autobot,

put a Sleep for a few seconds (>10) after _OL_Open and see if the problem persists.
In addition you can set $iOL_Debug = 2 before _OL_Open.
If you get 0x80004004 (Operation aborted) you have the same problem we are investigating at the moment.
What Windows do you run, what Outllok do you run?

UDFs:

Active Directory (2012-10-12 - Version 1.3.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

OutlookEX (2012-10-07 - Version 0.9.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

ExcelChart (2013-01-21 - Version 0.3.1.1 released) - Download - General Help & Support - Example Scripts

WordEX (2012-12-29 - Version 1.3 released) - Download

ExcelEX (2013-05-11 - Alpha 4 released) - Download





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users