Sub DD()
'DESCRIPTION: A description was not provided.
'Begin Recording
ActiveDocument.Selection = "/*"
ActiveDocument.Selection.NewLine
ActiveDocument.Selection = " * "
ActiveDocument.Selection.NewLine
ActiveDocument.Selection = "*/"
ActiveDocument.Selection.LineUp
'End Recording
End Sub
Sub TT()
'DESCRIPTION: A description was not provided.
'Begin Recording
ActiveDocument.Selection = "TRACE(" & """%s" & "(%d) ERR: %s/n"""+", __FILE__, __LINE__,"+"""ErrorData"""+");"
'End Recording
End Sub
Sub COMMENT()
'DESCRIPTION: A description was not provided.
'Begin Recording
ActiveDocument.Selection = "/**"
ActiveDocument.Selection.NewLine
ActiveDocument.Selection = " * <div> 函数描述 </div>"
ActiveDocument.Selection.NewLine
ActiveDocument.Selection = "* @param: ParamName[in] None。"
ActiveDocument.Selection.NewLine
ActiveDocument.Selection = "* @param: ParamName[in] None。"
ActiveDocument.Selection.NewLine
ActiveDocument.Selection = "* @return: None。"
ActiveDocument.Selection.NewLine
ActiveDocument.Selection = "* @author <a href=mailto:weekyhuang@gmail.com>H.K</a>"
ActiveDocument.Selection.NewLine
ActiveDocument.Selection = "*/"
'End Recording
End Sub
Sub SS()
'DESCRIPTION: SS
'ActiveDocument.Selection = "/* " + ActiveDocument.Selection + " */"
ActiveDocument.Selection = "/* */"
ActiveDocument.Selection.CharLeft dsMove, 3
End Sub
本文提供了几个VBA代码片段示例,包括添加注释、记录错误信息等实用功能。这些代码片段能够帮助开发者快速实现特定功能,提高编程效率。

被折叠的 条评论
为什么被折叠?



