ÿþOption Strict Off Option Explicit Off Imports System Imports EnvDTE Imports EnvDTE80 Imports System.Diagnostics Public Module SlurdgeFuncs Sub SwitchCppH() Dim CurrentFileName As String Dim NewFileName As String CurrentFileName = DTE.ActiveDocument.FullName If CurrentFileName.IndexOf(".h") <> -1 Then NewFileName = CurrentFileName.Replace(".h", ".cpp") ElseIf CurrentFileName.IndexOf(".cpp") <> -1 Then NewFileName = CurrentFileName.Replace(".cpp", ".h") ElseIf CurrentFileName.IndexOf(".cxx") <> -1 Then NewFileName = CurrentFileName.Replace(".cxx", ".h") ElseIf CurrentFileName.IndexOf(".c") <> -1 Then NewFileName = CurrentFileName.Replace(".c", ".h") End If If NewFileName <> CurrentFileName Then Try Dim ItemOp As ItemOperations ItemOp = DTE.ItemOperations ItemOp.OpenFile(NewFileName) Catch ex As Exception Finally End Try End If End Sub End Module