Forum Discussion
Word activex control error
We use Alaska XBase++ programming language and manipulate word document
via activex control for years.
The next program lines cause error since 30 july (perhaps after updating
word components). We also have an older computer running windows 7 and
office 2010, these codes work perfectly on it now.
// creating a new table in the document OK
oTabl:=oDocument:tables:add(oParagraph:range,nTablRow,nTablCol+2)
// error 1: setting the format of a nRow
oTabl:rows(nRow):range:font:size := 8
oTabl:rows(nRow):range:font:name := 'Times New Roman'
oTabl:rows(nRow):range:font:bold := 1
// error 2: (after commenting out error 1) setting the value of a cell
oTabl:cell(nRow,nCol):range:text := aHeader[nRow,nCol]
2 Replies
- PBalazsCopper Contributor
Thank You,
Affer debugging more thoroughly the program, it turned out after allocating a
table (nRows,nColumns, both >1) and trying to set the cells value,
the oCell:range.text:='text' command changes the size of the table to 1 row,
even if the row to be setted is greather than 1. It must be a new bug in the word program.
Is there an other command or method to set the value of a cell in a table, ?
How about simplifying font assignment:
WITH OBJECT oTabl:rows(nRow):range:font :name := "Times New Roman" :size := 8 :bold := .T. ENDWITH