hazed6809

_ol_folderAccess crashes outlook2013

7 posts in this topic

upgrading a older script that worked on outlook 2010 that is causing me issues on 2013

I have a shared mailbox called "NED-ASSET MANAGEMENT" and I want to access the "INBOX of it"

$oOutlook = _OL_Open(True)

$mailbox = "NED-ASSET MANAGEMENT"

$aFolder = _OL_FolderAccess($oOutlook, StringStripWS($mailbox, 3) & "\INBOX")

 

the error I get is

"C:\Program Files (x86)\AutoIt3\Include\OutlookEX.au3" (1269) : ==> The requested action with this object has failed.:
$oFolder = $oNamespace.Folders($aFolders[1])
$oFolder = $oNamespace^ ERROR

I am stubbed at what the issue is.

 

 

Share this post


Link to post
Share on other sites



Which version of AutoIt do you run now?
Which version of AutoIt did you run with Outlook 2010?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-02-03 - Version 1.4.7.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-03 - Version 1.2.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

v3.3.14.1 Now

V3.3.12 before

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

Then the problem is caused by the new way COM errors are handled.
I haven't fixed that in the OutlookEX UDF by now.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-02-03 - Version 1.4.7.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-03 - Version 1.2.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Could you please add

_OL_ErrorNotify(4)

at the top of your script and try again?
You then should get an error code (@error is being set).


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-02-03 - Version 1.4.7.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-03 - Version 1.2.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I went back to the original code, and started to re-fix my bugs, 1 step at a time.

First thing I was having issues with  the whole script was opening up a spreadsheet on a DFS server, sometimes it would open sometimes it would not.

putting quotes around it the filename worked everytime.  so I made that change to the original...Then the SQL credentials were wrong, but that is done after it read the email folder so that was a good sign...maybe I just screwed something up while debugging.

I had the Server information hardcoded into the program, in this version. I had earlier made a change to pull server info from an ini file.

(which was the code that is running on the Outlook 2010 box, successfully for the last month.)

ran it again and it ..... then crashed again,  couldn't find folder, very strange since this is the first thing that it does after the includes and I run this code in many

programs. 

Since I only needed 1 server for this program, I removed getting the rest of the servers variables from ini file. and just get the one server information I needed   and it is now working.

I still do not know why. but It now works (at least before I compile it)

Still scratching my head ....

Thank you

 

 

 

 

 

Share this post


Link to post
Share on other sites

Glad you were able to solve your problem :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-02-03 - Version 1.4.7.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-03 - Version 1.2.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

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

  • Similar Content

    • dumou8343
      By dumou8343
      Hey guys, I wanted to write this in the outlookEX thread but it was locked.
       
      I'm currently trying to get a script to write to a public calandar and I can't figure out how to tell autoit to write to the public calandar on the network,
       
      I currently have this witch works like I need it to but it writes in my personal calandar, can I make this write in the public one? I didn't find anything in the outlookEX help files
      #Include <OutlookEX.au3> Global $sStart = StringLeft(_Nowcalc(),16) Global $sEnd = StringLeft(_DateAdd("h", 3, _NowCalc()), 16) Global $oOutlook = _OL_Open() _OL_Wrapper_CreateAppointment($oOutlook, "TestMeeting", $sStart, $sEnd, "My office", False, "Testbody", 15, $olBusy, $olImportanceHigh, $olPrivate, $olRecursWeekly, $sStart, _DateAdd("w", 3, $sEnd), 1) Thanks guys!
    • rudi
      By rudi
      Hello.
      I'm trying to write a script to send multiple files using the local outlook installation (2007/2010/2013), to attach one or multiple files as attachment.
       
      As with the URL functionality the attachments never arrive in Outlook ("mailto:someone@company.com?subject=read-this&body=see-attachment&attachment=C:\temp\some-file.txt") I found the nice OutlookEx.UDF, but get lost.
       
       
      Here the readme https://www.autoitscript.com/wiki/OutlookEX_UDF_-_Mail_Item in the wiki describes, that it *IS* possible to send attachments, but I can't see an example howto handle single or multiple attachments.
       
      Where do I miss it?
       
      REgards ,Rudi.
    • Ligy
      By Ligy
      Hello everyone.
      Could you, please, help me with following problem?
      I need to send an email as different sender. The way "on behalf" does not fit me well enough. Much better for me would be something like declaring account credentials of the email i want to use and then use something like SendUsingAccount, but I am not able to figure out, how to get it from current OutlookEx.au3. Do you have any idea? Thanks a lot.
       
      Best Regards,
      Ligy
    • 9252Survive
      By 9252Survive
      Hello, 
      I am trying to use the latest version of OutlookEx.au3 and my script is able to send the email to the user first time but second time I am getting this error (see attached) I am trying to check a file every min and verify if the file has been modified, if the file was not modified then an email is sent. It works for the first time but fails in the second iteration. Also, attaching my code, I am very new to AutoIT, any help would be much appreciated! 

      Thanks! 
       
       
      #AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y #include <MsgBoxConstants.au3> #include <Debug.au3> #include <File.au3> #include <WinAPI.au3> #include <GuiComboBox.au3> #include <Date.au3> #include <AutoItConstants.au3> #include <Array.au3> #include <Process.au3> #include <StringConstants.au3> #include <FileConstants.au3> ; include for file functions #include <WinAPIFiles.au3> #include <_SingleScript.au3> #include <WinNet.au3> #include <Timers.au3> #include <INet.au3> #include <OutlookEX.au3> #include <DateCalc.au3> #Region AutoIT_Options Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=No case Opt("WinSearchChildren", 1) ;0=no, 1=search children also Opt("TrayIconDebug", 1) ;0=no info, 1=debug line info Opt("TrayAutoPause", 0) ; 0 = no pause , 1 = pause when tray icon is clicked #EndRegion AutoIT_Options Global $logFileName = "Test" & "-" & @YEAR &"_"&@MON& "." & "log" Global $logfile = @ScriptDir &"\"& $logFileName Global $LastModTime Global $LastModTime Global $LastModTimeStamp Global $FiletoCheck_1 Global $FiletoCheck_2 Global $oOutlook = _OL_Open() Func _SendAlert() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) ;Global $sCurrentUser = $oOutlook.GetNameSpace("MAPI").CurrentUser.Name ;_OL_Wrapper_SendMail($oOutlook, $sCurrentUser, "", "", "Travel Time Calc Engine ALERT! ", "An error has occurred, the log file has not changed since: " & $LastModTimeStamp, "", $olFormatHTML, $olImportanceHigh _OL_Wrapper_SendMail($oOutlook, "testemail@gmail.com", "", "", "ALERT! ", "An error has occurred, the log file has not changed since: " & $LastModTimeStamp, "", $olFormatHTML, $olImportanceHigh) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OutlookSendMail Wrapper Script", "Error sending mail. @error = " & @error & ", @extended: " & @extended) ;MsgBox(64, "OutlookEX UDF: _OutlookSendMail Wrapper Script", "Mail successfully sent to user '" & $sCurrentUser & "'!") _OL_Close($oOutlook) EndFunc Func _ChecklogFile() $FiletoCheck_2 = FileGetTime($logfile, 0, 1) ; Timestamp If $FiletoCheck_1 == $FiletoCheck_2 Then ; if the time stamp has not changed Msgbox("","","File has not changed") _SendAlert() Else Msgbox("","","File has changed") EndIf EndFunc ; Initial Launch, grab current GetTime $FiletoCheck_1 = FileGetTime($logfile,0,1) Local $YYYY = StringLeft ( $FiletoCheck_1, 4 ) Local $MM = StringMid ( $FiletoCheck_1,5,2) Local $DD = StringMid ( $FiletoCheck_1,7,2 ) Local $HH = StringMid ( $FiletoCheck_1,9,2 ) Local $Min = StringMid ( $FiletoCheck_1,11,2 ) Local $SS = StringMid ( $FiletoCheck_1,13,2 ) $LastModTimeStamp = $YYYY&"-"&$MM&"-"&$DD&" "&$HH&":"&$Min&":"&$SS While 1 Sleep(60000) ; check every 10 mins _ChecklogFile() WEnd  

    • water
      By water
      Is anyone interested in functions to work with Outlook "conversations"?
      You should be able to gather and manipulate items (mails, appointments etc.) which belong to the same conversation.