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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Microsoft Word Object 1

Status
Not open for further replies.

ppepin

IS-IT--Management
Mar 13, 2001
36
0
0
US
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.
 
Hello ppepin,

Define the constants explicitly?
Code:
Const wdHeaderFooterPrimary = 1
Const wdFieldPage = 33
regards - tsuji
 
Already done. The example above was for illustration only. These are defined and are being used they way you suggested.

Any other ideas of why I am receiving this error message and what does it mean?

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top