water Posted March 23, 2017 Author Share Posted March 23, 2017 I think this WAD. Because you are the one who sends the mail - but in the name of another user. If you want a copy of the sent mail in the sent folder of the other mailbox you need to copy the mail item. 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...
4bst1n3nz Posted March 23, 2017 Share Posted March 23, 2017 $aItems = _OL_ItemFind($oO, "*\Sent", $olMail, "[From]='Test' And [Subject]='Testt'", "", "", "Subject", "", 1) I try to find the Item by the senders name and the subject. But i'm doing something wrong. I got the information from msdn. It seems like its different. Link to comment Share on other sites More sharing options...
water Posted March 23, 2017 Author Share Posted March 23, 2017 What is the value of @error and @extended after you called the function? 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...
4bst1n3nz Posted March 23, 2017 Share Posted March 23, 2017 Error 5 Extended 0 Link to comment Share on other sites More sharing options...
water Posted March 23, 2017 Author Share Posted March 23, 2017 Should be $aItems = _OL_ItemFind($oO, "*\Sent", $olMail, "[SenderName]='Test' And [Subject]='Testt'", "", "", "Subject", "", 1) 4bst1n3nz 1 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...
HighlanderSword Posted March 24, 2017 Share Posted March 24, 2017 Hello Water, New question for you , I have a secondary PST folder open in outlook. I have an exiting Folder Called Microsoft, I now want to add subfolders underneath Microsoft I tried the below and it errors out . Global $oOutlook = _OL_Open() Global $oFolder = _OL_PSTAccess($oOutlook, "D:\Test.pst") _OL_FolderCreate($oOutlook, "\Microsoft\Issues", $olFolderInbox, $ofolder) Link to comment Share on other sites More sharing options...
water Posted March 24, 2017 Author Share Posted March 24, 2017 When you search the forum for posts where I ask users for more information to track down an issue, what do I ask for 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...
HighlanderSword Posted March 24, 2017 Share Posted March 24, 2017 Using Outlook 2013 and the latest and Greatest Version of your UDF Error code = 5 Extended = -2147024809 Link to comment Share on other sites More sharing options...
water Posted March 24, 2017 Author Share Posted March 24, 2017 Use: Global $oOutlook = _OL_Open() Global $oFolder = _OL_PSTAccess($oOutlook, "D:\Test.pst") _OL_FolderCreate($oOutlook, "Microsoft\Issues", $olFolderInbox, $ofolder) 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...
HighlanderSword Posted March 24, 2017 Share Posted March 24, 2017 It errors out with Code 4 indicating the folder already Exists, the only part that exists is the parent folder Name Microsoft , no sub folders are their yet Link to comment Share on other sites More sharing options...
water Posted March 24, 2017 Author Share Posted March 24, 2017 Then replace $oFolder with the name of the store as displayed in the folder pane and add a trailing "\Microsoft". Global $oOutlook = _OL_Open() Global $oFolder = _OL_PSTAccess($oOutlook, "D:\Test.pst") _OL_FolderCreate($oOutlook, "Issues", $olFolderInbox, "Test\Microsoft") 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...
TOTOTO Posted April 11, 2017 Share Posted April 11, 2017 Hi water, Thanks for the fantastic UDF. I just started to use it 2 weeks ago and already loved it. One question about keeping the signature when modify the body: Is it still working in Outlook 2016? I tried with the example in your wiki page, tried all 3 types of body format, but unfortunately, none of them work. The signature is gone right after I added the content. I tried to add a ConsoleWrite after save the body into $sBody: #include <OutlookEX.au3> Global $oOutlook = _OL_Open() ;=========== ; Plain Text ;=========== $oItem = _OL_ItemCreate($oOutlook, $olMailItem, "", "", "Subject=Subject for BodyFormat=Plain Text") $oItem.BodyFormat = $olFormatPlain $oItem.GetInspector $sBody = $oItem.Body $oItem.Body = "Text: Mail Text" & $sBody $oItem.Display But the Console only writes "Saved body", seems like the sBody does not get anything from the mail. Confirmed the mail does contain a signature by adding $oItem.Display and sleep(3000) before " $sBody = $oItem.Body" line. Not to sure how to debug this, please help. Thanks a lot! Link to comment Share on other sites More sharing options...
water Posted April 11, 2017 Author Share Posted April 11, 2017 Glad you like the UDF I'm running Outlook 2010 and the example script you posted above works just fine. Can you please post the script YOU run (including ConsoleWrite Statements etc.)? 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...
TOTOTO Posted April 11, 2017 Share Posted April 11, 2017 Hi water, Thanks for the reply. Below is the code I used for test: #include <OutlookEX.au3> Global $oOutlook = _OL_Open() $oItem = _OL_ItemCreate($oOutlook, $olMailItem, "", "", "Subject=Subject for BodyFormat=RTF") $oItem.BodyFormat = $olFormatRichText ;$oItem.GetInspector $sBody = $oItem.HTMLBody $oItem.Display Sleep(3000) ConsoleWrite( "Following is the body saved: " & @CRLF & $sBody & @CRLF ) $oItem.HTMLBody = "RTF: <b>Mail</b> Text" & $sBody Since I insert the $oItem.Display before sleep(3000), so I can see the signature is there in the mail body. But after 3 seconds, the mail body changed to only one line "RTF: Mail Text" without signature. The Console only writes "Following is the body saved: " and an empty line. Link to comment Share on other sites More sharing options...
water Posted April 12, 2017 Author Share Posted April 12, 2017 Seems to be a problem with Outlook 2016. I only have Outlook 2010 and your script works fine here. 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...
TOTOTO Posted April 13, 2017 Share Posted April 13, 2017 18 hours ago, water said: Seems to be a problem with Outlook 2016. I only have Outlook 2010 and your script works fine here. Thanks for the testing. Too bad, can't downgrade the version of Outlook on the company notebook. Do you have plan to make this working on Outlook 2016 anytime soon? Link to comment Share on other sites More sharing options...
water Posted April 13, 2017 Author Share Posted April 13, 2017 As soon as I know how to solve this problem I will implement it. But unfortunately I have been unable to find any information about this problem nor a solution on the web. If you do, please let me know 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...
TOTOTO Posted April 13, 2017 Share Posted April 13, 2017 Thanks water. Is there any kind of debug that I can run on my side to help you investigate the issue? Link to comment Share on other sites More sharing options...
water Posted April 13, 2017 Author Share Posted April 13, 2017 At the moment I have no idea. I searched the web and didn't find a hint how to solve this problem. If you find some code snippets for Outlook 2016 I should be able to translate them to AutoIt. 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...
TOTOTO Posted April 18, 2017 Share Posted April 18, 2017 On 13/04/2017 at 5:45 PM, water said: At the moment I have no idea. I searched the web and didn't find a hint how to solve this problem. If you find some code snippets for Outlook 2016 I should be able to translate them to AutoIt. Sorry, I'm totally outsider for outlook. Have no idea about how to collect code snippets. Looks like have to wait someone else can help this part. Link to comment Share on other sites More sharing options...
Recommended Posts