I am creating a document in MSWord.
The document is in 2 sections
Cover
Detail - both in separate prg called from the main do_word.prg which sets up the document
I have tried adding a summary section
which works fine when the other two pages are commented out from do_word.prg but the table doesn't appear when they are included. this is my code for the last item and first item of the two original prgs with the new one between
Clearly I am not understanding this completely - what am I missing?
Thanks
webber
The document is in 2 sections
Cover
Detail - both in separate prg called from the main do_word.prg which sets up the document
I have tried adding a summary section
which works fine when the other two pages are commented out from do_word.prg but the table doesn't appear when they are included. this is my code for the last item and first item of the two original prgs with the new one between
Code:
.InsertDateTime("d MMMM , yyyy", .f.)
.TypeParagraph
.InsertBreak(7)
ENDWITH
-------------------------------------
new section in separate prg
PARAMETERS loDoc
#DEFINE wdAlignParagraphCenter 1
SELECT (mytable)
WITH SELECTION
myalias = alias()
.FONT.SIZE = 18 && heading text
.font.bold =.t.
reportname = 'kitchen Summary '
.TypeText(reportname)
.TypeParagraph
ENDWITH
loSelection = loWord.Selection
loSelection.ParagraphFormat.Alignment = wdAlignParagraphCenter
loTable = loDoc.Tables.Add(loSelection.Range,30,7)
*-- Fill in the first row with
*-- column header information
p =1
loTable.Cell(p,1).Range.Text = " "
loTable.Cell(p,2).Range.Text = "Plums"
loTable.Cell(p,3).Range.Text = "Carrots"
p =p + 1
*-- Fill in the rest of the rows with values from mytable
*-- column header information
loTable.Cell(p,1).Range.Text = 'INT'
p =p + 1
loTable.Cell(p,1).Range.Text = ''
p =p + 1
loTable.Cell(p,1).Range.Text = " Images"
loTable.Cell(p,2).Range.Text = transform(mytable.niipe)
loTable.Cell(p,3).Range.Text = transform(mytable.niiote)
;
etc
etc
WITH SELECTION
.InsertBreak(7)
ENDWITH
------------------
detail prg
PARAMETERS loDoc
WITH SELECTION
N = 1
SCAN
Clearly I am not understanding this completely - what am I missing?
Thanks
webber