Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- oWord := ComObjCreate("Word.Application") ; create MS Word object
- Document := oWord.Documents.Add ; create new document
- oWord.Visible := 1 ; Make winword visible
- range := oWord.ActiveDocument.Range(0, 0) ; Set Range
- oWord.ActiveDocument.tables.Add(range,1,2) ; Add table in range
- oWord.Selection.Tables(1).Style := "Table Grid" ; set style
- oWord.Selection.Tables(1).Cell(1,2).Range.Select ; select a cell
- oWord.Selection.TypeText("Hi hi") ; type a text in selected cell
- oWord.Selection.EndKey ; from here I couldn't able to create a new table
- oWord.Selection.TypeParagraph
- range := oWord.ActiveDocument.Range(0, 0)
- oWord.ActiveDocument.tables.Add(range,10,5)
- oWord.Selection.Tables(1).Style := "Table Grid"
- oWord.Selection.Tables(1).Cell(1,3).Range.Select ; get error 0x800A1735 and it mentions 'Cell' The requested member of the collection does not exist
- ;oWord.Selection.TypeText("Hi di")
- oWord.Quit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement