-
word equations
2009-12-31
-
word automation table
2009-12-29
#vb_ref: Function Add(Range As Range, NumRows As Long, NumColumns As Long, [DefaultTableBehavior], [AutoFitBehavior]) As Table
def add_table(doc, range, rows, cols)
doc.Tables.Add({'Range' => range, 'NumRows' => rows, 'NumColumns' => cols})
# doc.Tables.Add(range, rows, cols)
end
#vb_ref: Function Cell(Row As Long, Column As Long) As Cell
def set_table_cell(table, i, j, text)
table.Cell(i, j).Range.Text = text
end
references: -
word automation range
2009-12-28
The Range object represents a contiguous area in a document, and is defined by a starting character position and an ending character position.
Ranges can be obtained in many ways. Many Word objects, like Sentence and Paragraph, have a Range property that contains an object reference to a Range object for the original object.
sel_range = word.Selection.Range
p_range = doc.Paragraphs(3).Rangereferences:
-
word automation document
2009-12-28
http://msdn.microsoft.com/en-us/library/aa158471(office.10).aspx
word = WIN32OLE.connect('Word.Application') #get word application object
active_doc = word.ActiveDocument #get the active documentnew_doc = word.Documents.Add() #create a new documentnew_doc.SaveAs('C:\hello.doc'); #save the new document
