As you read this, though I have pretty good experience in C++ and Java, please keep in mind that I am a complete beginner when it comes to VB. :)
Here is one idea of what I want to do:
Option Strict Off
Option Explicit Off
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports EnvDTE90a
Imports EnvDTE100
Imports System.Diagnostics
Public Module RecordingModule
Sub TemporaryMacro()
// what is the right way to declare and define filename?
dim String filename = DTE.ActiveDocument.FullName();
DTE.ActiveDocument.Save()
// how do I make a system call, I'm pretty sure this is not correct
System("astyle.exe " + filename);
// reload the formatted file, but how?
End Sub
End Module
Alternatively, if I cannot reload it, I could do something like:
Option Strict Off
Option Explicit Off
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports EnvDTE90a
Imports EnvDTE100
Imports System.Diagnostics
Public Module RecordingModule
Sub TemporaryMacro()
// what is the right way to declare and define filename?
dim String filename = DTE.ActiveDocument.FullName();
DTE.ActiveDocument.Save()
DTE.ActiveDocument.Close()
// how do I make a system call, I'm pretty sure this is not correct
System("astyle.exe " + filename);
DTE.ExecuteCommand("File.Open",filename);
End Sub
End Module
I don't much like that though as it will cause the windows to close/reopen and I will probably loose all of my undo history.
Can anyone give me some guidance here?
Thanks!