Cant open section of Word Document

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Hello,
I am trying to view a section of a Word document from with a C# 2.0
program using the following:

ProcessStartInfo procInfo = new ProcessStartInfo("Word.exe");
procInfo.FileName = Path.GetDirectoryName(Application.ExecutablePath)
+
@"\Docs\Mydoc.doc #section1";
procInfo.UseShellExecute = true;
System.Diagnostics.Process.Start(procInfo);

I can view just the document, but if I include #section1, I get a
'can't find file' error. Is there any way round this.

thanks
 
Chris said:
Hello,
I am trying to view a section of a Word document from with a C# 2.0
program using the following:

ProcessStartInfo procInfo = new ProcessStartInfo("Word.exe");
procInfo.FileName = Path.GetDirectoryName(Application.ExecutablePath)
+
@"\Docs\Mydoc.doc #section1";

Presumably, you want to pass @"\Docs\Mydoc.doc" as the filename and
"#section1" as the arguments. In this case, it looks like you're trying
to open a file literally called @"\Docs\Mydoc.doc #section1", which
doesn't exist.

Alun Harford
 
Back
Top