'' 'import com object' ''
import time
import win32com.client as win32
word = win32.gencache.EnsureDispatch('Word.Application',1)
word.Visible = 1
'' 'content' ''
doc = word.Documents.Add()
doc.Top = 1
doc.Content.Text = "hello world"
doc.Content.Paragraphs.Add()
doc.Content.InsertAfter("hello2 ?")
doc.Content.InsertAfter("hello world 3")
'' 'расположение таблицы' ''
location = doc.Range()
location.Move() # place table at the end
'' '
первый стол' ''
table = doc.Content.Tables.Add(location, 2, 4)
'' '
второй стол' ''
table2 = doc.Content.Tables.Add(location, 2, 2)
table2.PreferredWidth = 40
table.ApplyStyleHeadingRows = 0
table.AutoFormat(16)
table.PreferredWidth = 400
doc.Content.InsertAfter("hello4 hello5")