S
Steven Huypens
Hi,
I recently got my new PC with Windows XP SP2, Office 2003 and VS.NET
2003. My code was working fine on my old Win2k, Office2k, VS.Net
machine, but now I get this error.
"'Word.Bookmarks' does not contain a definition for 'Item'"
Here is the function I'm using :
private void BookMarkReplaceRange(ref Word.Document ThisDocument, string
bookmarkName, string newText)
{
try
{
object missingValue = Type.Missing;
object oBookmarkName = bookmarkName;
Word.Range rng = ThisDocument.Bookmarks.Item(
ref oBookmarkName).Range;
rng.Text = newText;
object oRng = rng;
ThisDocument.Bookmarks.Add(bookmarkName, ref oRng);
}
catch (Exception ex)
{
CGlobals.Logger.WriteLine(LogType.Error, ex);
}
}
Does anyone have an idea what might be the problem ?
grtz,
Steven
I recently got my new PC with Windows XP SP2, Office 2003 and VS.NET
2003. My code was working fine on my old Win2k, Office2k, VS.Net
machine, but now I get this error.
"'Word.Bookmarks' does not contain a definition for 'Item'"
Here is the function I'm using :
private void BookMarkReplaceRange(ref Word.Document ThisDocument, string
bookmarkName, string newText)
{
try
{
object missingValue = Type.Missing;
object oBookmarkName = bookmarkName;
Word.Range rng = ThisDocument.Bookmarks.Item(
ref oBookmarkName).Range;
rng.Text = newText;
object oRng = rng;
ThisDocument.Bookmarks.Add(bookmarkName, ref oRng);
}
catch (Exception ex)
{
CGlobals.Logger.WriteLine(LogType.Error, ex);
}
}
Does anyone have an idea what might be the problem ?
grtz,
Steven