'------------------------------------------------------------------------------ 'FILE DESCRIPTION: Function Header '------------------------------------------------------------------------------ Sub FunctionHeader() 'DESCRIPTION: Standard function comment header 'TODO: Put macro code here ActiveDocument.Selection = "/**************************************************************************************************" ActiveDocument.Selection.NewLine ActiveDocument.Selection = "Desc:" ActiveDocument.Selection.NewLine ActiveDocument.Selection = "Date: "+CStr(Date) ActiveDocument.Selection.NewLine ActiveDocument.Selection = "**************************************************************************************************/" ActiveDocument.Selection.NewLine End Sub Sub FileHeaderCpp() 'DESCRIPTION: Header for .cpp files 'TODO: Put macro code here ActiveDocument.Selection = "//**************************************************************************************************" ActiveDocument.Selection.NewLine ActiveDocument.Selection = "//" ActiveDocument.Selection.NewLine ActiveDocument.Selection = "// .cpp" ActiveDocument.Selection.NewLine ActiveDocument.Selection = "//" ActiveDocument.Selection.NewLine ActiveDocument.Selection = "// Description: " ActiveDocument.Selection.NewLine ActiveDocument.Selection = "//" ActiveDocument.Selection.NewLine ActiveDocument.Selection = "// Created by: PutYourNameHereInTheMacroFileInPlaceOfthis "+CStr(Date) ActiveDocument.Selection.NewLine ActiveDocument.Selection = "//" ActiveDocument.Selection.NewLine ActiveDocument.Selection = "//**************************************************************************************************" ActiveDocument.Selection.NewLine End Sub Sub Invert() 'DESCRIPTION: Invert an assignment operation Dim win set win = ActiveWindow if win.type <> "Text" Then MsgBox "You can only run this macro when a text editor window is active." else StartLine = ActiveDocument.Selection.TopLine EndLine = ActiveDocument.Selection.BottomLine If EndLine < StartLine Then Temp = StartLine StartLine = EndLine EndLine = Temp End If For i = StartLine To EndLine TmpBlock = "" ActiveDocument.Selection.GoToLine i ActiveDocument.Selection.StartOfLine dsFirstText ActiveDocument.Selection.EndOfLine dsExtend CmtBlock = ActiveDocument.Selection Trim(CmtBlock) equal = Instr(CmtBlock,"=") semi = Instr(CmtBlock, ";") If equal <> 0 Then TmpBlock = Left(CmtBlock, equal-1) If semi <> 0 then CmtBlock = Mid(CmtBlock, equal + 1, semi-equal-1) else CmtBlock = Right(CmtBlock, Len(CmtBlock) - equal) End If CmtBlock = Trim(CmtBlock) TmpBlock = Trim(TmpBlock) if semi <> 0 then CmtBlock = CmtBlock + " = " + TmpBlock + ";" else CmtBlock = CmtBlock + " = " + TmpBlock End If End If ActiveDocument.Selection = CmtBlock Next End If End Sub