.Documents.Open AND kind ?

  • Thread starter Thread starter Steph
  • Start date Start date
S

Steph

hello,
because msdn is so poor... somebody did he write a similar script ?
(DTE/DTE2)

_applicationObject.Documents.Open(docPath, "?string kind?", false);

i must type the "string kind"... but with what ?



thank...



steph
 
because msdn is so poor... somebody did he write a similar script ?
(DTE/DTE2)
_applicationObject.Documents.Open(docPath, "?string kind?", false);

i must type the "string kind"... but with what ?

Hi,

Use one of the view kind constants. For example:

_applicationObject.Documents.Open(docPath, Constants.vsViewKindCode, false);

Best Regards,
Dustin Campbell
Developer Express Inc.
 
Steph said:
hello,
because msdn is so poor... somebody did he write a similar script ?
(DTE/DTE2)

_applicationObject.Documents.Open(docPath, "?string kind?", false);

i must type the "string kind"... but with what ?

Well, let's start with this quote from MSDN:

"This method supports the .NET Framework infrastructure and is not intended
to be used directly from your code."

Thus the reason the documentation is poor on this method, it is not intended
to be called in code. That being said, try "Auto".
 
because msdn is so poor... somebody did he write a similar script ?
(DTE/DTE2)
_applicationObject.Documents.Open(docPath, "?string kind?", false);

i must type the "string kind"... but with what ?

Also, the preferred way to do this is to use the ItemOperations.OpenFile()
method:

_applicationObject.ItemOperations.OpenFile(docPath, Constants.vsViewKindCode);

This method returns an EnvDTE.Window and you can access the EnvDTE.Document
that was opened through its Document property.

Best Regards,
Dustin Campbell
Developer Express Inc.
 

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

Back
Top