Imports System Imports EnvDTE Imports EnvDTE80 Imports System.Diagnostics Public Module Module1 Sub ReloadFile() ' Make a note of the current file. Dim file As String = DTE.ActiveDocument.FullName ' Make a note of the current cursor position. Dim ep As EditPoint = CType(DTE.ActiveDocument.Selection, TextSelection).ActivePoint.CreateEditPoint ' Save the current file. DTE.ActiveDocument.Save() ' Close the current file. DTE.ActiveDocument.Close() ' Open the current file. DTE.ItemOperations.OpenFile(file) ' Move cursor to the previously saved position. CType(DTE.ActiveDocument.Selection, TextSelection).MoveToLineAndOffset(ep.Line, ep.LineCharOffset) End Sub End Module