Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;v1 AHK
- f1::
- oWord := ComObjCreate("Word.Application") ; create MS Word object
- oWord.Documents.Add ; create new document
- oWord.Selection.Paragraphs.Format.Style := "Heading 1"
- oWord.Selection.Paragraphs.Format.Style := "No Spacing"
- oWord.Selection.Font.Bold := 1 ; bold
- oWord.Selection.Font.Italic := 0 ; italic
- oWord.Selection.Font.Color := 0000 ; black
- oWord.Selection.Font.Size := 18 ; Font Size 18
- oWord.Selection.Font.Name := "Arial" ; Theme Font Arial
- oWord.Selection.TypeText("Tab Nation") ; type text
- oWord.Selection.TypeParagraph ; New line
- oWord.Selection.TypeText("Date: ")
- oWord.Selection.InsertDateTime
- oWord.Selection.TypeParagraph ; New line
- oWord.Selection.TypeParagraph ; New line
- oWord.Selection.TypeText("sub to me pretty please") ; type text
- oWord.ActiveDocument.PageSetup.Orientation := 0
- oWord.Visible := True
- oWord.Activate
- oWord.ActiveDocument.Tables.Add(Range := oWord.Selection.Range
- , NumRows := 6
- , NumColumns := 3
- , DefaultTableBehavior := wdWord9TableBehavior := 0
- , AutoFitBehavior:= wdAutoFitFixed := 0)
- _ := oWord.Selection.Tables(1)
- if(_.Style <> "Table Grid")
- _.Style := "Table Grid"
- _.ApplyStyleHeadingRows := True
- _.ApplyStyleLastRow := False
- _.ApplyStyleFirstColumn := True
- _.ApplyStyleLastColumn := False
- _.ApplyStyleRowBands := True
- _.ApplyStyleColumnBands := False
- oWord.Visible := 1, oWord.Activate ; make it visible and activate it.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement