javaCity
javaCity

Reputation: 4318

How to open a source file in a project?

I am trying to open a file in an open project in Visual Studio using the extension API. I found this

http://msdn.microsoft.com/en-us/library/vstudio/bb164729(v=vs.110).aspx

and

http://msdn.microsoft.com/en-us/library/vstudio/microsoft.visualstudio.shell.interop.ivsuishellopendocument.openstandardeditor(v=vs.110).aspx

but I don't understand how to implement it. Is there any guide for it or am I looking in the wrong place?

Upvotes: 4

Views: 1537

Answers (1)

Damian Drygiel
Damian Drygiel

Reputation: 18025

Look here:

Usage:

DTE.ExecuteCommand("File.OpenFile", @"C:\path\to\source_file.cs");

TIP: To test the method open VS Command Window and simply type File.OpenFile

Upvotes: 3

Related Questions