G
Guest
i need to create a new word 2003 document within a c# web application. this
is the code i´m using
private Microsoft.Office.Interop.Word.ApplicationClass WordApp = new
Microsoft.Office.Interop.Word.ApplicationClass();
object missing = System.Reflection.Missing.Value;
object docType = 0;
object isVisible = true;
// Create a new Document, by calling the Add function in the Documents
collection
Microsoft.Office.Interop.Word.Document aDoc = WordApp.Documents.Add(ref
missing, ref missing, ref docType, ref missing);
WordApp.Visible = true;
aDoc.Activate();
but i´m getting an error in aDoc.Activate() line
this is the error
error:
[NullReferenceException: Object reference not set to an instance of an
object.]
worddoc.StandardReport.Page_Load(Object sender, EventArgs e) in
c:\mcms\worddoc\standardreport.aspx.cs:39
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
any help would be appreciate or any suggestion about how to do this process
thanks in advance
is the code i´m using
private Microsoft.Office.Interop.Word.ApplicationClass WordApp = new
Microsoft.Office.Interop.Word.ApplicationClass();
object missing = System.Reflection.Missing.Value;
object docType = 0;
object isVisible = true;
// Create a new Document, by calling the Add function in the Documents
collection
Microsoft.Office.Interop.Word.Document aDoc = WordApp.Documents.Add(ref
missing, ref missing, ref docType, ref missing);
WordApp.Visible = true;
aDoc.Activate();
but i´m getting an error in aDoc.Activate() line
this is the error
error:
[NullReferenceException: Object reference not set to an instance of an
object.]
worddoc.StandardReport.Page_Load(Object sender, EventArgs e) in
c:\mcms\worddoc\standardreport.aspx.cs:39
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
any help would be appreciate or any suggestion about how to do this process
thanks in advance