Hi,
I am trying to open an existing word document, the execution happens
with no error but Word does not come up and my document does not open.
This is the code I am using..
Process.Start(@"C:\Program Files\Microsoft Office\OFFICE11\winword.exe");
ProcessStartInfo info = new ProcessStartInfo(@"C:\Program Files\Microsoft Office\OFFICE11\winword.exe");
I used another way to do this, but the result is same...the other way is used is
protected void Button1_Click(object sender, EventArgs e)
{
CCWordApp test;
test = new CCWordApp();
test.Open(@"D:\Experiments\WordOpen\Letter\Brief India foutieve facturen.doc");
}
public class CCWordApp
{
private Word.ApplicationClass oWordApplic =new Word.ApplicationClass();
private Word.Document oDoc=new Word.Document();
public CCWordApp()
{
}
public void Open(string strFileName)
{
object fileName = strFileName;
object readOnly = false;
object isVisible = true;
object missing = System.Reflection.Missing.Value;
oWordApplic.Visible = true;
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);
oDoc.Activate();
}
}
Please Help me