lolipop Posted April 3, 2012 Author Posted April 3, 2012 (edited) saving as a mail item and import back doesn't work either. one thing i notice for this particular code _OL_ItemCreate($oOutlook, $olMailItem, $aFolder[1], "D:testOutSwitch.au3.msg") changing the above coding for the template/source location doesn't seems to affect the script. Meaning, for example if I change to _OL_ItemCreate($oOutlook, $olMailItem, $aFolder[1], "D:testOutSwitch.au3.msg.123") The file "D:testOutSwitch.au3.msg.123" doesn't exist at all in that folder. But the script complete successfully without any error. Weird....that's why I think my coding is wrong somewhere. Edited April 3, 2012 by lolipop
water Posted April 3, 2012 Posted April 3, 2012 Another question: What version of the UDF do you use? Please check the first few lines of the include file for "; UDF Version ...: 0.x.0" My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
lolipop Posted April 3, 2012 Author Posted April 3, 2012 UDF 0.6.0 SciTE version 2.28 and also tested with SciTE version 1.79
water Posted April 3, 2012 Posted April 3, 2012 Version 0.6.0 is the most current version. What I don't get is why a non existing template doesn't raise an error at your place. I get @error = 6 which is fine if the template does not exist. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
water Posted April 3, 2012 Posted April 3, 2012 Got it. There is a bug in the flow of your script. Please replace$aFolder = _OL_FolderAccess($oOutlook, "*\Shared Folder") If @error Then MsgBox(16, $sTitle, "Error returned by _OL_FolderAccess: " & @error & ", @extended: " & @extended) _OL_ItemCreate($oOutlook, $olMailItem, $aFolder[1], "D:\test\OutSwitch.au3.msg") If @error Then MsgBox(16, $sTitle, "Error returned by _OL_ItemCreate: " & @error & ", @extended: " & @extended) Endifwith$aFolder = _OL_FolderAccess($oOutlook, "*\Shared Folder") If @error Then MsgBox(16, $sTitle, "Error returned by _OL_FolderAccess: " & @error & ", @extended: " & @extended) Else _OL_ItemCreate($oOutlook, $olMailItem, $aFolder[1], "D:\test\OutSwitch.au3.msg") If @error Then MsgBox(16, $sTitle, "Error returned by _OL_ItemCreate: " & @error & ", @extended: " & @extended) EndIf My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
lolipop Posted April 3, 2012 Author Posted April 3, 2012 omg...you nail the problem. It's working perfectly. It's really amazing how one small error mades a diff in the whole script.
water Posted April 3, 2012 Posted April 3, 2012 Glad the problem could be solved! My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
lolipop Posted April 3, 2012 Author Posted April 3, 2012 Thank you so much. I really appreciate you taking the time and effort for the advise and assistance.
lolipop Posted April 5, 2012 Author Posted April 5, 2012 (edited) Hi water,one quick question. I'm trying to use _OL_FolderAccess on the "Test Shared" folder that belong to Christ Bow Mailbox which has been shared to me but I'm getting either error 1($iOL_FolderType is missing or not a number) or error 4(Specified folder could not be found).$aFolder = _OL_FolderAccess($oOutlook, "Mailbox - Christ BowTest Shared") If @error Then MsgBox(16, $sTitle, "Error returned by _OL_FolderAccess: " & @error & ", @extended: " & @extended)I have try using FolderTree and FolderGet code shown below to help me retrieve the folder path but I can't seem to find the folder path for it. All I get is folder path for David Hoo mailbox.$aResult = _OL_FolderTree($oOutlook) _ArrayDisplay($aResult, "Folder Result")Do I have to select or set Christ Bow Mailbox first before I can access his "Test Shared" folder? Edited April 5, 2012 by lolipop
water Posted April 5, 2012 Posted April 5, 2012 Please give this code a try:$aFolder = _OL_FolderAccess($oOutlook, "Mailbox - Christ BowTest Shared") If @error Then MsgBox(16, $sTitle, "Error returned by _OL_FolderAccess: " & @error & ", @extended: " & @extended) My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
lolipop Posted April 5, 2012 Author Posted April 5, 2012 oh this solved the problem. Didn't expect "" to be the fault cos I was following the example. You save me once again. Thanks.
water Posted April 5, 2012 Posted April 5, 2012 I see the problem! When you specify "\\" then the name of the user you want to access has to follow (like you enter in the recipient field if you want to send him an email). _OL_FolderAccess resolves the user and accesses any sepcified subfolder. You specified the whole name of the mailbox. So this should work too: Does this work for you: $aFolder = _OL_FolderAccess($oOutlook, "\\Christ Bow\Test Shared", $olFolderInbox) If @error Then MsgBox(16, $sTitle, "Error returned by _OL_FolderAccess: " & @error & ", @extended: " & @extended) Maybe I need to enhance the docu My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
lolipop Posted April 6, 2012 Author Posted April 6, 2012 I remember trying that before and it didn't work. The difference is I never specific the folder type enumeration. I'm not wif my pc now so need to wait til Monday before I can try that out. Will post the outcome ASAP. Thanks.
water Posted April 6, 2012 Posted April 6, 2012 I'm on vacation next week so I won't respond till the 16th. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
lolipop Posted April 6, 2012 Author Posted April 6, 2012 No problem. Thanks for ur help n enjoy ur holiday.
water Posted April 6, 2012 Posted April 6, 2012 I'm sure I will. I will stay for a few days in Vienna (Austria) and enjoy Apfelstrudel and Sachertorte My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
lolipop Posted April 10, 2012 Author Posted April 10, 2012 I see the problem! When you specify "" then the name of the user you want to access has to follow (like you enter in the recipient field if you want to send him an email). _OL_FolderAccess resolves the user and accesses any sepcified subfolder. You specified the whole name of the mailbox. So this should work too: Does this work for you: $aFolder = _OL_FolderAccess($oOutlook, "Christ BowTest Shared", $olFolderInbox) If @error Then MsgBox(16, $sTitle, "Error returned by _OL_FolderAccess: " & @error & ", @extended: " & @extended) Maybe I need to enhance the docu Just to report, this doesn't work. I've got error stating "Variable used without being declared"
water Posted April 10, 2012 Posted April 10, 2012 Which variable? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
lolipop Posted April 10, 2012 Author Posted April 10, 2012 #include <OutlookEx.au3> ShellExecute("Outlook", "/profile Outlook", "", "", @SW_HIDE) If @error Then Exit MsgBox(16, $sTitle, "Error returned by ShellExecute: " & @error & ", @extended: " & @extended) $oOutlook = _OL_Open() If @error Then Exit MsgBox(16, $sTitle, "Error returned by _OL_Open: " & @error & ", @extended: " & @extended) $aFolder = _OL_FolderAccess($oOutlook, "Christ BowTest Shared", $olFolderInbox) If @error Then MsgBox(16, $sTitle, "Error returned by _OL_FolderAccess: " & @error & ", @extended: " & @extended) Else $aItems2 = _OL_ItemFind($oOutlook, $aFolder[1], $olDocument, "", "Subject", "Test Share", "EntryID") If @error Then MsgBox(16, $sTitle, "Error returned by _OL_ItemFind: " & @error & ", @extended: " & @extended) Else If $aItems2[0][0] = 0 Then _OL_ItemCreate($oOutlook, $olMailItem, $aFolder[1], @UserProfileDir & "Desktoptestmsg.msg") If @error Then MsgBox(16, $sTitle, "Error returned by _OL_ItemCreate: " & @error & ", @extended: " & @extended) Else _OL_ItemDelete($oOutlook, $aItems2[1][0], Default) If @error Then MsgBox(16, $sTitle, "Error returned by _OL_ItemDelete: " & @error & ", @extended: " & @extended) _OL_ItemCreate($oOutlook, $olMailItem, $aFolder[1], @UserProfileDir & "Desktoptestmsg.msg") If @error Then MsgBox(16, $sTitle, "Error returned by _OL_ItemCreate: " & @error & ", @extended: " & @extended) EndIf EndIf EndIf hmm..I'm too sure either... The autoit output windows wrote is C:Documents and SettingsusernameDesktoptest.au3 (8) : ==> Variable used without being declared.: MsgBox(16, $sTitle, "Error returned by _OL_FolderAccess: " & @error & ", @extended: " & @extended) MsgBox(16, ^ERROR I have try removing the affected line "MsgBox(16, $sTitle, "Error returned by _OL_FolderAccess: " & @error & ", @extended: " & @extended) ". The script will run without error but the MSG file doesn't get save into the mention folder. Anyway just to clarify again in case you get the wrong idea, the "Mailbox - Christ BowTest Shared" works fine. Only the "Christ BowTest Shared" doesn't work. Hey, thought you're having your holidays? Go enjoy yourself man.
water Posted April 15, 2012 Posted April 15, 2012 Variable $sTitle is simply used to set the window title of the MsgBox. AddGlobal $sTitle = "<Here goes your title>"to the top of your script and the error messages should be gone. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now