Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table disappears in MSWord

Status
Not open for further replies.

webmonger

Programmer
Mar 13, 2004
66
AU
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

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
 
Addendum

I now see that the table appears at the end of the document - but I am non the wiser.

Webber
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top