Introduction
Many a times, it happens when we work on a big project and the work is done by more than one member of the team.. It may happen that the code is getting reviewed and edited by more than one member of the team. In the time like this, it is very necessary to add comment above the added code with developer name and date-time with the inline logic due to which code edition or addition is performed... For this, a simple macro can be developed which can later be associated with a key-stroke so that it becomes very easy to add the inline comment...
Im working as a team leader in a sw-dev company and have made it compulsory to add this kind of comment whenever any existing code is changed and it has proved a damn good way to manage projects efficiently...
Using the code
Creating the macro named comment and pasting the code below will work fine...
'------------------------------------------------------------------------------
'FILE DESCRIPTION: New Macro File
'------------------------------------------------------------------------------
Sub comment()
'Begin Recording
ActiveDocument.Selection = "//============================================================//"
ActiveDocument.Selection.NewLine
ActiveDocument.Selection = "//Development By : Jigar Mehta"
ActiveDocument.Selection.NewLine
ActiveDocument.Selection = "//Date : [" & now() & "]"
ActiveDocument.Selection.NewLine
ActiveDocument.Selection = "//============================================================//"
'End Recording
End Sub
//
Points of Interest
Now one can map the macro 'comment' with key-stroke... I have made a standard as [Ctrl + Shift + F].. So, while coding when anybody presses that, a whole four line comment with developer name and date-time will be inserted in the code...