Confuzzled Posted October 23, 2020 Posted October 23, 2020 Hint: Beware as some items pass/return strings and others objects. Error check each call and debug write output to console helps a lot to make the code more robust.
water Posted October 24, 2020 Author Posted October 24, 2020 When you create an item using _OL_ItemCreate the function returns the object of the newly created item. Simply pass this object to _OL_itemModify and use property "Body" to set the text. All available properties for a task can be found here when you select "Properties" in the left pane. 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
cag8f Posted November 4, 2020 Posted November 4, 2020 @water OK thanks for that. >> When you create an item using _OL_ItemCreate the function returns the object of the newly created item. >> Simply pass this object to _OL_itemModify OK, that clarifies what to pass to _OL_ItemModify as the $oOL parameter. Quote and use property "Body" to set the text. All available properties for a task can be found here when you select "Properties" in the left pane. That clarifies what to pass to _OL_ItemModify as the $sP1 parameter. But what should I pass to _OL_ItemModify as the $vItem parameter? It is described as that, "EntryID or object of the item." Is this the object returned by _OL_FolderAccess()?
water Posted November 4, 2020 Author Posted November 4, 2020 Please check the help file that comes with the UDF. It explains each function and how to use the parameters. 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
cag8f Posted November 4, 2020 Posted November 4, 2020 OK. I was able to figure out my issue and fix it. I had indeed read the help file, but in this case had gotten confused between Outlook object and item object. Thanks!
cag8f Posted November 5, 2020 Posted November 5, 2020 OK I'm back. I'm now able to create a new blank task with _OL_ItemCreate(), and add text to its body with _OL_ItemModify(). But to the body I'd like to now insert a bullet point (screenshot). Is there a way to do this with _OL_ItemModify(), or another OutlookEX function? Or would I have to use core AutoIt to find the appropriate 'insert bullet point' control and click it? To enter a bullet point manually, in the body I type '*' followed by a space, and a bullet point is then automatically inserted. But when I pass that text to _OL_ItemModify(), only `* ` is inserted--the bullet point is not created. Thanks.
water Posted November 5, 2020 Author Posted November 5, 2020 The Body-Property only supports simple text. The HTML-Property is not available for the task object. This means you have to use the Word Editor to set bullet points. An example can be found in the _OL_ItemCreate.au3 script. 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
cag8f Posted November 17, 2020 Posted November 17, 2020 OK thanks for that. The example was helpful and I got it sorted.
cag8f Posted November 18, 2020 Posted November 18, 2020 (edited) @water Sorry, I'm back with a related question about the Word editor. Per the example in `_OL_ItemCreate.au3`, my AutoIt program switches to the Word editor, using the line Global $oDoc = $oItem.GetInspector.WordEditor ; Get the Microsoft Word Document Object Model Is there a way to 'undo' this switch-to-Word-editor change? Here is the full code. The reason I ask is because immediately after I ran my AutoIt program, the bullet points inserted into Outlook began to be styled and formatted differently than usual--in a way that is undesirable. These changes appear to be permanent (at least, I can't figure out how to revert them). Here are some of the specific changes that have occurred. Usually the bullet point at each indentation level is a different style (screenshot). But now, each of those is the same style (screenshot). The horizontal space between each indentation level is now smaller. There are other ways the bullet points behave that are now different, and undesirable. These differences are now present in any new Outlook task I create, and even after the AutoIt program stops and I reboot my computer. Thanks. Edited November 18, 2020 by cag8f
water Posted November 18, 2020 Author Posted November 18, 2020 I have no idea why a script should change a global setting by just using bullet points. I haven't worked with lists and AutoIt yet. Maybe you should use the ApplyListTemplate method? 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
cag8f Posted November 19, 2020 Posted November 19, 2020 OK thanks for the reply. I had another look today, and the issue seems to be resolved, through no direct action of my own. I can promise though that yesterday I did indeed test the issue after closing AutoIt and reboooting, and it was still present. Anyway, I acknowledge that I could have made some error during my observations. I'm glad it's resolved. >> Maybe you should use the ApplyListTemplate method? In case this issue returns, that's a good idea--thanks!
cag8f Posted November 19, 2020 Posted November 19, 2020 OK I'm back. This time with a question about the ListGalleries object. I've defined a range, and am now trying to execute ListGalleries('wdBulletGallery') to return a single ListGallery object, with this line: ConsoleWrite($oRange.ListGalleries('wdBulletGallery') & @CRLF) But that seems to be printing a blank value. Shouldn't that print an object to the console? The eventual goal of this exercise is to change the template applied to the list format. My full code is below. ___ My Full Code #include <OutlookEX\OutlookEX.au3> Global $oOL = _OL_Open(); Open an Outlook object. Global $oItem = _OL_ItemCreate($oOL, 3); Creates a blank task. The integer 3 represents a task item. Global $text = "Here is some text" _OL_ItemModify($oOL, $oItem, Default, "Body=" & $text) ; Add a custom string to the body of the newly created task. Global $oDoc = $oItem.GetInspector.WordEditor ; Get the Microsoft Word Document Object Model Global $oRange = $oDoc.Range ; Get the range object $oRange.Collapse(1) ; Move the range start/end to the start of the document $oRange.MoveStart(2, 2) ConsoleWrite('wdBulletGallery is:' & @CRLF) ConsoleWrite($oRange.ListGalleries('wdBulletGallery') & @CRLF) _OL_Close($oOL)
water Posted November 19, 2020 Author Posted November 19, 2020 wdBulletGallery is an enumeration as defined here. So you need to replace 'wdBulletGallery' with the corresponding numeric value. 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
cag8f Posted November 20, 2020 Posted November 20, 2020 OK thanks for that--very good to know about enumerations. But I've changed the function call to $oRange.ListGalleries(1) and it is still printing a blank to the console. Thoughts?
water Posted November 21, 2020 Author Posted November 21, 2020 On 11/19/2020 at 4:55 PM, cag8f said: to return a single ListGallery object, with this line: ConsoleWrite($oRange.ListGalleries('wdBulletGallery') & @CRLF) But that seems to be printing a blank value. Shouldn't that print an object to the console? No, as objects can't be printed to the Console. Here you get an example (written in VB) how to apply a Listtemplate to a range. Untested translation to AutoIt: Global Const $wdBulletGallery = 1 ; Bulleted list $oGalleries = $oDoc.Application.ListGalleries($wdBulletGallery) ; Returns a collection of Galleries $oBulletGallery = $oGalleries.ListTemplates(3) $oRange.ListFormat.ApplyListTemplate($oBulletGallery) 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 December 11, 2020 Author Posted December 11, 2020 Version 1.6.3.0 has been released! 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
ReM Posted January 3, 2021 Posted January 3, 2021 hallo, the udf is great, but I have a problem with the dateformat. When I used the function ItemFind and filter by [start] > ‘2021-01-04 00:00’ , I get all Appointments since 1 April and not since 4. Jan. When I used [start] > 2020-12-26 00:00 I get all since 26. Dez. When I create an Appointment I used the dateformat YYYY-MM-DD and everything is fine. I’m confused. My Country code of the PC is German.
water Posted January 4, 2021 Author Posted January 4, 2021 (edited) We get a lot of problems from the different date/time formats and conversion to the needed format. Can you please test the following format "DD-MM-YYYY HH:MM"? Seems to works as described here. Edited January 4, 2021 by water Corrected the date/time format to DD-MM-YYYY 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
ReM Posted January 4, 2021 Posted January 4, 2021 Hello Water, this is what i done... when i filter with "[start] > ‘2021-01-04 00:00’ " . I like to get all Appointments since 4 Jan 2021. Is it a individuell Problem (Outlook / Office / Win/ confuguration ) and why is this Format function on _OL_ItemCreate and not with _OL_ItemFind?
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