0

Is there a way to save all unsaved documents (files with the '*' in the VS editor tab) using DTE or something else in a VSIX command?

unsaved file

I'm creating a command that reads the current document's syntax tree, but I cannot access unsaved changes made to that document, so I wish to save all files open in the editor before running my code.

Peter Macej
  • 4,831
  • 22
  • 49

1 Answers1

0
DTE.ExecuteCommand("File.SaveAll");

This will execute the Save All command, as if you executed it from GUI:

1

Peter Macej
  • 4,831
  • 22
  • 49