K
Kevin
Hi
I've this code to open a Word 2000, but this generate an error. I reference
to Microsoft Word 9.0 Object Library.
WordApp = new Word.ApplicationClass();
if(WordApp != null)
{
WordApp.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone;
WordDoc = WordApp.Documents.Open(ref DocFile, ref FalseParam, ref TrueParam,
ref FalseParam,
ref DocPassword, ref NullObject, ref NullObject, ref NullObject, ref
NullObject,
ref NullObject,ref NullObject, ref IsVisible);
if(WordDoc != null)
{
WordDoc.ActiveWindow.Selection.WholeStory(); // GENERATE ERROR >
NullReferenceException
WordText = WordDoc.ActiveWindow.Selection.Text;
}
}
The ActiveWindow property is null.
Whats wrong in this code?
Thanks
I've this code to open a Word 2000, but this generate an error. I reference
to Microsoft Word 9.0 Object Library.
WordApp = new Word.ApplicationClass();
if(WordApp != null)
{
WordApp.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone;
WordDoc = WordApp.Documents.Open(ref DocFile, ref FalseParam, ref TrueParam,
ref FalseParam,
ref DocPassword, ref NullObject, ref NullObject, ref NullObject, ref
NullObject,
ref NullObject,ref NullObject, ref IsVisible);
if(WordDoc != null)
{
WordDoc.ActiveWindow.Selection.WholeStory(); // GENERATE ERROR >
NullReferenceException
WordText = WordDoc.ActiveWindow.Selection.Text;
}
}
The ActiveWindow property is null.
Whats wrong in this code?
Thanks