General information
Category:
COM/DCOM and OLE Automation
Title:
AutoFormat a grid in Word
I am having problems automating a Word grid. This may be basic stuff for you guys but I am fairly new to this and I can't seem to sort it out. Does anybody have any ideas? Thanks in advance. Greg
Here is my code ;
#DEFINE True .T.
#DEFINE False .F.
&& Populates the grid
WITH loTable
FOR lnRow = 1 TO ALEN(laTableData, 1)
FOR lnColumn = 1 TO ALEN(laTableData, 2)
.Cell(lnRow,lnColumn).Range.InsertAfter(laTableData[lnRow,lnColumn])
ENDFOR
ENDFOR
.AutoFormat ;
(wdTableFormatGrid6, ;
True, ;
True, ;
True, ;
True, ;
True, ;
False, ;
True, ;
False, ;
True)
ENDWITH
&& ERROR; 'variable wdTableFormatGrid6 is not found'
=============================
I have also tried:
.AutoFormat ;
Format:=wdTableFormatGrid6, ;
ApplyBorders:= True, ;
ApplyShading:=True, ;
ApplyFont:=True, ;
ApplyColor:=True, ;
ApplyHeadingRows:=True, ;
ApplyLastRow:=False, ;
ApplyFirstColumn:=True,;
ApplyLastColumn:=False, ;
AutoFit:=True
&& I get a Syntax error.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only