Skip to Main Content
Word 2007 Document Automation with VBA and VSTO
book

Word 2007 Document Automation with VBA and VSTO

by Scott Driza
March 2009
Intermediate to advanced content levelIntermediate to advanced
617 pages
17h 24m
English
Jones & Bartlett Learning
Content preview from Word 2007 Document Automation with VBA and VSTO
The Visual Basic Environment
Procedures
Procedures encompass both functions and subroutines. These
can be distinguished by the syntax in which they appear.
This procedure is a subroutine:
Sub Subroutine1()
'Underlying Code
End Sub
This procedure is a function:
Function Function1() As Integer
'Underlying code and return value
End Function
There are two ways to insert a procedure into a code module.
The first is to choose the appropriate module and then choose
Insert | Procedure, which opens the dialog box shown in Fig-
ure 3-23.
The second (and easier) method is just to type either “Sub” for
a subroutine or “Function” for a function followed by the
appropriate ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Word 2003 Document Automation with VBA, XML, XSLT, and Smart Documents

Word 2003 Document Automation with VBA, XML, XSLT, and Smart Documents

Scott Driza

Publisher Resources

ISBN: 9781598220476