AutoITSM Posted July 26, 2011 Posted July 26, 2011 Hi AutoITSM,the problem is - as I mentioned in my previous post - that the password property can't be accessed using the Outlook object model.The only way to solve the problem is to start a second script, wait for the password GUI to appear and enter the password. A good example is the _OL_Warnings.au3OK.I see.Now by another way,I first determine whether the outlook has been opened,as follows:Func if_OLOPEN() If ProcessExists("Outlook.exe")=0 Then MsgBox(262192,"HIN","OUTLOOK Hasn't been opened! Please open OUTLOOK manually!") Exit Else $OL_Handle = _OL_Open() Return $OL_Handle EndIfEndFuncThis method is a little stupid, if there are other ways, Please tell me.
AutoITSM Posted July 26, 2011 Posted July 26, 2011 (edited) Hi AutoITSM, the problem is - as I mentioned in my previous post - that the password property can't be accessed using the Outlook object model. The only way to solve the problem is to start a second script, wait for the password GUI to appear and enter the password. A good example is the _OL_Warnings.au3 Sorry for trouble you again,but i have another question need you to resolve. $oItem = _OL_ItemCreate($oOutlook, $olMailItem, "Outlook-UDF-Test\SourceFolder\mail", "", "Subject=TestMail", "BodyFormat=" & $olFormatHTML, "HTMLBody=Bodytext in <b>bold</b>.") For the HTMLBody property, How to write a line break? I tried like< "HTMLBody=123"&@CRLF&"456"> ,but the string "123" and "456" are still in the sam row. SO i changed the line 2144 and 2145 like belows: $oOL_Item.ItemProperties.Item(StringStripWS(StringLeft($aOL_Properties[$iOL_Index], $iOL_Pos - 1), 3) ).value = _ StringMid($aOL_Properties[$iOL_Index], $iOL_Pos + 1) (delete the second StringStripWS function) and it is not working. Please help...thx again Edited July 26, 2011 by AutoITSM
AutoITSM Posted July 26, 2011 Posted July 26, 2011 For the HTMLBody property, How to write a line break? I tried like< "HTMLBody=123"&@CRLF&"456"> ,but the string "123" and "456" are still in the sam row. SO i changed the line 2144 and 2145 like belows: $oOL_Item.ItemProperties.Item(StringStripWS(StringLeft($aOL_Properties[$iOL_Index], $iOL_Pos - 1), 3) ).value = _ StringMid($aOL_Properties[$iOL_Index], $iOL_Pos + 1) (delete the second StringStripWS function) and it is not working. Please help...thx again Hi AutoITSM, ... Ha,i solved the problem. So is HTML syntax, just use </br> . Just like "HTMLBody=123</br>456" I understand it a little bit inside the principle of. Thank you agan.
water Posted July 26, 2011 Author Posted July 26, 2011 Please have a look at the code of _OL_Open and _OL_Close (if you like). _OL_Open checks if Outlook is already running. If Outlook is already started a global variable ($fOL_AlreadyRunning) is set. _OL_Close shuts down Outlook only if it has been started by _OL_Open. Or you can set parameter $fOL_ForceClose to True then Outlook is closed anyway. So you don't have to check if Outlook is already running, just call _OL_Open and _OL_Close. 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 July 26, 2011 Author Posted July 26, 2011 Ha,i solved the problem.So is HTML syntax, just use </br> . Just like "HTMLBody=123</br>456"I understand it a little bit inside the principle of. Thank you agan.It's HTML syntax, that's true. Every HTML tag has an opening and a closing form. The closing form has a slash after the left bracket. Example: "Write this text in bold" would be in HTML "Write this text in <b>bold</b>"In your case "</br>" is the closing tag - but a line break doesn't need a closing tag. Correct would be "<br>". 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
AutoITSM Posted July 26, 2011 Posted July 26, 2011 It's HTML syntax, that's true. Every HTML tag has an opening and a closing form. The closing form has a slash after the left bracket. Example: "Write this text in bold" would be in HTML "Write this text in <b>bold</b>"In your case "</br>" is the closing tag - but a line break doesn't need a closing tag. Correct would be "<br>".Thank you very much,i learned so much~:)
water Posted August 7, 2011 Author Posted August 7, 2011 Version 0.4.0 has been released.Please test before using in production!For download please see my signature. 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
anixon Posted August 23, 2011 Posted August 23, 2011 I have been looking through the Outlook UDF's for a script that supports a process which simply saves any file/s attached to an email to default folder and then on completion of that process delete the email and its attachment. I am ok with most of the prcoesses however the method of dealing with the attachment escapes me. If you can point me in the right direction that would be very much appreciated. Ant..
water Posted August 23, 2011 Author Posted August 23, 2011 (edited) This could be done with a script like this one. Please change line 2 and 3 so you get the object/EntryID of the mail item to process. $oOL = _OL_Open() $aItems = _OL_ItemFind($oOL, ....) $oOL_Item = $aItems... _OL_ItemSave($oOL, $oOL_Item, Default, "C:\Temp\", $olTXT, 2) If @error Then Exit MsgBox(16, "OutlookEX Example Script", "Error saving attachments: @error = " & @error & ", @extended = " & @extended) _OL_ItemDelete($oOL, $oOL_Item) If @error Then Exit MsgBox(16, "OutlookEX Example Script", "Error deleting mail item: @error = " & @error & ", @extended = " & @extended) _OL_Close($oOL) Edited August 23, 2011 by water 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
anixon Posted August 23, 2011 Posted August 23, 2011 Thanks for the prompt response very much appreciated. Ant..
Jaboowaki Posted August 30, 2011 Posted August 30, 2011 Hello Guys, I am using a Outlook.au3 to retrieve contacts but now I also need to modify and delete contacts as well. Any suggestions?
Sath Posted September 1, 2011 Posted September 1, 2011 Hi Guys, I'm kind of new to AutoIt and have only done some basic scripts with AutoIt which I think is amazing! (had to be said ). I was thinking a project to work on and I had the idea of using AutoIt to move emails in my mailbox to their appropriate folders in Outlook based on the domain of the sender. Did some googling and found your OutlookEX.au3 which I am very impressed with. I am struggling with how to access the inbox and then gather the sender email address from the email currently focused on. If you point me in the write direction I would really appreciate it. Cheers Sath
water Posted September 4, 2011 Author Posted September 4, 2011 (edited) Use something like:#include <OutlookEx.au3> $oOL = _OL_Open() ; Connect to Outlook $aSelectedItems = _OL_FolderSelectionGet($oOL) ; Get the selected items from the active explorer $aOL_Properties = _OL_ItemGet($oOL, $aSelectedItems[1][0], Default, "SenderEmailAddress") ; Get the SenderEmailAddress property of the first selected itemYou have to make sure that the user selects the inbox and a mail item you want to process. Or you could use Outlook events.Please have a look at the _OL_Test_NewMail_Event.au3 shows how to handle events. Edited September 4, 2011 by water 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 September 18, 2011 Author Posted September 18, 2011 Version 0.5.0 has been released. Please test before using in production! For download please see my signature. 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
Sath Posted September 20, 2011 Posted September 20, 2011 Hi water, firstly apologies for posting in the wrong area, secondly thank you for the reply. I managed to produce a similar result by using _OL_ItemFind. Thanks for your assistance.
water Posted September 20, 2011 Author Posted September 20, 2011 Glad you got it working 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
shai Posted September 21, 2011 Posted September 21, 2011 my profile in computer is in hebrew. when i try using _OL_PSTGet function my profile name is get bad characters. see the screanshot:
water Posted September 21, 2011 Author Posted September 21, 2011 (edited) I hope this is only a presentation problem (code page) What do you do with the returned path (what functuions etc. do you call) and do you get any errors when you use the pathname? Edited September 21, 2011 by water 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
shai Posted September 21, 2011 Posted September 21, 2011 i try this #include <OutlookEX.au3> Global $oOutlook = _OL_Open() Global $aPST = _OL_PSTGet($oOutlook) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_PSTGet Example Script", "Error accessing PST archives. @error = " & @error & ", @extended: " & @extended) Run('explorer.exe ' & $aPST[1][2]) it is open my root profile folder: C:\Users\symen\Documents
water Posted September 21, 2011 Author Posted September 21, 2011 (edited) Why do you want to open the PST using explorer.exe? The PST is already accessed by Outlook so you can do whatever you want using the UDF functions. Edited September 21, 2011 by water 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