Advertisement
danrim

AHK COM Word Example

Aug 3rd, 2020
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #SingleInstance, Force
  2.  
  3. oWord := ComObjCreate("Word.Application")
  4. oWord.Documents.Add
  5. oWord.Visible := 1
  6. Sleep 500
  7.  
  8. oWord.Selection.Font.Bold := 1
  9. oWord.Selection.TypeText("Hello world!")
  10. oWord.Selection.Font.Bold := 0
  11. oWord.Selection.TypeParagraph
  12. Sleep 500
  13. oWord.Selection.TypeText("This is a simple example on how to use AHK and Word Objects.")
  14. Sleep 500
  15. MsgBox, 4, , Shall we close the window?
  16. IfMsgBox, Yes
  17. oWord.Quit()
  18.  
  19. ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement