Hello,

I'm trying to open a Word template file, set some bookmark values, then
save the document from within a .NET C# Windows application (.NET 1.1,
using VS.NET 2003 & Office 2003). I've been following the information
given on the CodeProject
(http://www.codeproject.com/aspnet/wordapplication.asp). Modifying his
wrapper class a little, I'm running into a problem. VS is refusing to
compile the wrapper because it doesn't accept the Bookmarks.Item
method. Any help with this issue would be greatly appreciated.

Relevant code for the class below. Thanks
Evan

//// CODE ////

using System;
using System.ComponentModel;
using Microsoft.Office.Interop.Word;

namespace WordApplication
{
/// <summary>
///
/// </summary>
///

public class CCWordApp
{
private ApplicationClass oWordApplic; // a reference to Word
application
private Document oDoc; // a reference to the document

public CCWordApp()
{
// activate the interface with the COM object of Microsoft Word
oWordApplic = new ApplicationClass();
}

// Open a file (the file must exists) and activate it
public void Open( string strFileName)
{
object fileName = strFileName;
object readOnly = false;
object isVisible = true;
object missing = System.Reflection.Missing.Value;

oDoc = oWordApplic.Documents.Open(ref fileName, ref missing,ref
readOnly,
ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing,
ref missing, ref missing, ref isVisible,ref missing,ref missing,ref
missing,ref missing);

oDoc.Activate();
}

public void InsertText(string text, string bookmark) {
object bm = bookmark;
oDoc.Bookmarks.Item(bookmark).Range.Text = text;
}