I am looking for some assistance with a problem I am having. I am creating a Microsoft Word document from an ASP page using Server.CreateObject("Word.Application"
. The document creates fine and I am able to manipulate it, format it, put in tables and populate cells.
My issue is page numbering. I have successfully added headers and footers to all the pages. The header is pretty substantial and includes a table. I want to place the pagenum field in one of the cells in the header and I am using the following code:
SET myHeaderex = doc.Sections(2).Headers(wdHeaderFooterPrimary)
SET mytableex = myHeaderex.Range.Tables.Add(myHeaderex.Range, 11, 7)
mytableex.Range.Cells(42).Range.Fields.Add mytableex.Range.Cells(42).Range, wdFieldPage
I receive the following error message:
Microsoft Word error '800a11fd'
This command is not available.
/test2.asp, line 631
Has anyone tried this? Any input will be appreciated.
Thanks.
My issue is page numbering. I have successfully added headers and footers to all the pages. The header is pretty substantial and includes a table. I want to place the pagenum field in one of the cells in the header and I am using the following code:
SET myHeaderex = doc.Sections(2).Headers(wdHeaderFooterPrimary)
SET mytableex = myHeaderex.Range.Tables.Add(myHeaderex.Range, 11, 7)
mytableex.Range.Cells(42).Range.Fields.Add mytableex.Range.Cells(42).Range, wdFieldPage
I receive the following error message:
Microsoft Word error '800a11fd'
This command is not available.
/test2.asp, line 631
Has anyone tried this? Any input will be appreciated.
Thanks.