Hi George,
I did something similar using the AutoHotKey utility. I created a script that prompts me for the subroutine name and then creates the code for me. Very similar to your VB script.
Here is the AutoHotKey script if anyone wants to use it. It is setup to be triggered by the "Windows key + s".
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; The following line defines the Hot key to use. It is the Windows key + s.
#s::
InputBox, SubName, Subroutine Name, Enter a subroutine name
if ErrorLevel
return
Else
SendInput Sub %SubName%{Enter}
SendInput {raw}+++Define FIELDS/+Subroutine
SendInput {Enter}
SendInput Edit Point Start %SubName%{Enter}
SendInput {Tab}{Down}+{Tab}
SendInput {raw}+If FIELDS/+Subroutine
SendInput {Enter}{Tab}{Down}+{Tab}
SendInput Edit Point End %SubName%{Enter}
SendInput {Tab}{Down}+{Tab}
SendInput {raw}+++UnDefine FIELDS/+Subroutine
SendInput {Enter}{Tab}{Up}{Up}{Up}{Up}+{Tab}
return
Dean Eshleman,
Everence Financial