dbs179 Posted April 12, 2014 Share Posted April 12, 2014 Strange. Do you get any error messages when you insert _OL_ErrorNotify(2) before _OL_Open? water, I get three pop ups with errors when Outlook is not open but none when it is. And by the way, thanks for the great support. I really appreciate it. Dave Link to comment Share on other sites More sharing options...
water Posted April 12, 2014 Author Share Posted April 12, 2014 Can you please post the messages you see when Outlook is not running? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
dbs179 Posted April 13, 2014 Share Posted April 13, 2014 Can you please post the messages you see when Outlook is not running? They are in my last post, are they not showing up for you? I see them fine. Link to comment Share on other sites More sharing options...
water Posted April 14, 2014 Author Share Posted April 14, 2014 (edited) Now I see them too. #1 is being expected as the UDF tries to connect to an already running instance. If there is none this error is being displayed. #2 Is in function _OL_ItemSendReceive #3 Is caused by _OL_Close. There is no running instance of Outlook, hence this error. You are running the 64 bit version of Outllok. Can you try to compile the AutoIt script for 64 bit too? Edited April 14, 2014 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
dbs179 Posted April 18, 2014 Share Posted April 18, 2014 Now I see them too. #1 is being expected as the UDF tries to connect to an already running instance. If there is none this error is being displayed. #2 Is in function _OL_ItemSendReceive #3 Is caused by _OL_Close. There is no running instance of Outlook, hence this error. You are running the 64 bit version of Outllok. Can you try to compile the AutoIt script for 64 bit too? Sorry, I was out of town this week, but I just tried it again by compiling the test script for 64 bit with the same exact errors. Link to comment Share on other sites More sharing options...
water Posted April 18, 2014 Author Share Posted April 18, 2014 I only have Outlook 2010 32 bit. Might this be a new behavior of Outlook 2013? Could you insert Sleep(60000) before _OL_Close so Outlook has 60 seconds to send the mail? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
antistud Posted April 19, 2014 Share Posted April 19, 2014 I am sorry if this has already been answered and I am grateful for your help. I am trying to make a script that will import contacts from a csv but I would like it to skip duplicate contacts. Can anyone help. #AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y #include <OutlookEX.au3> ; ***************************************************************************** Global $oOutlook = _OL_Open() ; ***************************************************************************** $aOL_Item = _OL_ItemFind($oOutlook, "*\Outlook-UDF-Test\SourceFolder\Contacts", Default, '[FirstName] = "TestFirstName"', "", "", "EntryID", "", 0, "") If $aOL_Item[0][0] = 0 Then Global $iResult = _OL_ItemImport($oOutlook, "C:\temp\contacts.csv", "", "", 1, "*\Contacts", $olContactItem) _OL_Close($oOutlook) Link to comment Share on other sites More sharing options...
water Posted April 19, 2014 Author Share Posted April 19, 2014 What's the question? Do you get an error? Doesn't the script work as expected? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted April 19, 2014 Author Share Posted April 19, 2014 Have you read the remarks for function _OL_ItemImport? ; Remarks .......: The first line of the file (header line) has to be a list of Outlook item property names. ; The manual import allows to map user defined names to Outlook item property names. ; This isn't supported with this function! ; E.g.: ; Name,Mobile Phone,Business Phone,e-mail is invalid ; FullName,MobileTelephoneNumber,BusinessTelephoneNumber,Email1Address is fine! How does the header line of your CSV look like? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
antistud Posted April 20, 2014 Share Posted April 20, 2014 I can get the file to import just fine. what I am lacking is the ability to check fro duplicate contacts and skip them. Link to comment Share on other sites More sharing options...
water Posted April 20, 2014 Author Share Posted April 20, 2014 You can's skip duplicates whith function _OL_ItemImport. The import feature can't be accessed by COM so _OL_ItemImport only mimics the feature. You could import all contacts to a temporary folder and then compare the entries of both folders and move those which are no duplicates. Then delete the temporary folder. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
antistud Posted April 21, 2014 Share Posted April 21, 2014 (edited) What is the proper way to insert a variable in a parameter $c1 = Example $aOL_Item = _OL_ItemFind($oOutlook, "*\Outlook-UDF-Test\SourceFolder\Contacts", Default, '[FullName] = $c1', "", "", "EntryID", "", 0, "") If $aOL_Item[0][0] = 0 Then Global $iResult = _OL_ItemImport($oOutlook, "C:\temp\example.csv", "", "", 1, "*\Contacts", $olContactItem) _OL_Close($oOutlook) I get >"C:Program Files (x86)AutoIt3SciTE..autoit3.exe" /ErrorStdOut "C:Users******Desktop_OL_ItemModify.au3" "C:Users*****Desktop_OL_ItemModify.au3" (10) : ==> Subscript used on non-accessible variable.: If $aOL_Item[0][0] = 0 Then Global $iResult = _OL_ItemImport($oOutlook, "C:tempexample.csv", "", "", 1, "*Contacts", $olContactItem) If $aOL_Item^ ERROR >Exit code: 1 Time: 0.703 Edited April 21, 2014 by antistud Link to comment Share on other sites More sharing options...
water Posted April 21, 2014 Author Share Posted April 21, 2014 What's the value of @error after you called _OL_Itemfind? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
antistud Posted April 21, 2014 Share Posted April 21, 2014 If the [FullName] = $c1 it should skip the import If not it will import contacts.csv I guess I did not define @error Link to comment Share on other sites More sharing options...
water Posted April 21, 2014 Author Share Posted April 21, 2014 (edited) $aOL_Item = _OL_ItemFind($oOutlook, "*\Outlook-UDF-Test\SourceFolder\Contacts", Default, '[FullName] = "' & $c1 & '"', "", "", "EntryID", "", 0, "") If @error Then Exit MsgBox(0, "Error", "_OL_ItemFind returned error = " & @error) Edited April 21, 2014 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
dbs179 Posted April 21, 2014 Share Posted April 21, 2014 I only have Outlook 2010 32 bit. Might this be a new behavior of Outlook 2013? Could you insert Sleep(60000) before _OL_Close so Outlook has 60 seconds to send the mail? Water, Same issue even with the sleep, oddly enough it works fine with my work Outlook which is Outlook 2010 32bit. Thanks, Dave Link to comment Share on other sites More sharing options...
water Posted April 21, 2014 Author Share Posted April 21, 2014 So if the same script works with Oultook 2010 and doesn't with Outlook 2013 then I think the problem is caused by Outlook 2013. I will check the web - maybe I find a list of things that have changed with Outlook 20103. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted April 21, 2014 Author Share Posted April 21, 2014 This describes the changes in Outlook 2013. Have you made any settings in the "Send/Receive Groups"? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
dbs179 Posted April 21, 2014 Share Posted April 21, 2014 This describes the changes in Outlook 2013. Have you made any settings in the "Send/Receive Groups"? Nope, no changes. Maybe it is because I have outlook set up using a hotmail email address at home? Link to comment Share on other sites More sharing options...
water Posted April 21, 2014 Author Share Posted April 21, 2014 I've never used Outllook with Hotmail so can't tell. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Recommended Posts