Cant open section of Word Document

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
 
A

Alun Harford

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top