Advertisement
Guest User

Untitled

a guest
Nov 17th, 2020
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. #include <OutlookEX\OutlookEX.au3>
  2.  
  3. Global $oOL = _OL_Open(); Open an Outlook object.
  4.  
  5. ConsoleWrite("type $oOL: " & VarGetType($oOL) & @CRLF)
  6. ConsoleWrite($oOL )
  7.  
  8. Global $oItem = _OL_ItemCreate($oOL, 3) ; Creates a blank task. The integer 3 represents a task item.
  9. Global $text = "Issue" & @crlf & @crlf & "To Do" & @crlf & @crlf & "After" & @crlf & "555"; A string containing three lins of text.
  10.  
  11. _OL_ItemModify($oOL, $oItem, Default, "Body=" & $text); Add a custom string to the body of the newly created task.
  12.  
  13. Global Const $wdCollapseStart = 1 ; Collapse the range to the starting point
  14. Global Const $wdWord = 2 ; A word
  15. Global Const $wdCharacter = 1 ; A character
  16. Global $oDoc = $oItem.GetInspector.WordEditor ; Get the Microsoft Word Document Object Model
  17. Global $oRange = $oDoc.Range ; Get the range object
  18. ;~ $oRange.InsertAfter("This is a test") ; Insert some text
  19. ;~ $oRange.ListFormat.ApplyBulletDefault ; Move the range start/end to the start of the document
  20.  
  21. $oRange.Collapse($wdCollapseStart) ; Move the range start/end to the start of the document
  22.  
  23. $oRange.MoveStart(2, 2) ; Move the range start/end to word 1
  24. $oRange.ListFormat.ApplyBulletDefault ; Move the range start/end to the start of the document
  25.  
  26. $oRange.MoveStart(4, 2) ; Move the range start/end to word 1
  27. $oRange.ListFormat.ApplyBulletDefault ; Move the range start/end to the start of the document
  28.  
  29. $oRange.MoveStart(6, 2) ; Move the range start/end to word 1
  30. $oRange.ListFormat.ApplyBulletDefault ; Move the range start/end to the start of the document
  31.  
  32.  
  33. $oRange.Collapse($wdCollapseStart) ; Move the range start/end to the start of the document
  34. $oRange.MoveStart($wdWord, 1) ; Move the range start/end to word 2
  35. $oRange.MoveEnd($wdWord, 1) ; Move the range end two words to the right
  36. $oRange.MoveEnd($wdCharacter, -1) ; Move the range end one character to the left (so the space isn't included)
  37. $oRange.Font.Bold = True ; Set the font.underline property for the range
  38.  
  39. _OL_Close($oOL)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement