Sections.Item(1).Headers and office 2003

E

Eugene

Hello,
I need some help. I have a code that was working fine in C# when it
was compiled with Office XP installed on my PC. Now I got a new PC
with office 2003 installed and I can't compile the code, I'm getting
following error: "'Word.Sections' does not contain a definition for
'Item'"
and here is the code I'm trying to compile:

private Word.Application m_app;
private Word.Document m_doc;
private Word.Range hRange;
private Word.HeaderFooter footer;


m_app = new Word.ApplicationClass();
m_doc = m_app.Documents.Add(ref template, ref newTemplate, ref
documentType, ref visible);
hRange = m_doc.Sections.Item(1).Headers.Item(Word.WdHeaderFooterIndex.wdHeaderFooterPrimary).Range;

footer = m_doc.Sections.Item(1).Footers.Item(Word.WdHeaderFooterIndex.wdHeaderFooterPrimary);

If somebody can help me, I will really appreciate it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top