views:

42

answers:

1

I saw an article in a blog about opening .doc files from External Tools in Visual Studio 2008 (C# language spec in this case).

I can't find this article anymore. Does anyone know how to do this (and also for .pdfs)? There doesn't seem to be much guidance on doing this in VS.

Thanks

+2  A: 

It's pretty easy to do. Go to "Tools -> External tools...." Set the command to the path of MSWord (or PDF reader of your choice) and set arguments to the path of the document.

For example, in my PC:

  • Title: C# Language Specification
  • Command: C:\Program Files (x86)\Microsoft Office\Office12\WINWORD.EXE
  • Arguments: "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC#\Specifications\1033\CSharp Language Specification.doc"

Make sure you put the argument path in quotes if it contains characters like space, as it needs to be treated as a single argument to the command.

Mehrdad Afshari
Thanks for that!
dotnetdev
Btw, does the file have to be in the program directory (Visual Studio)? It doesn't work otherwise, but I thought it wouldn't matter.
dotnetdev
No it doesn't matter. Make sure you put the argument path in double quotes.
Mehrdad Afshari
That explains my errors. Thanks.
dotnetdev