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
[VBA]
Public Function GetNumPayments(ByVal LoanAmount As Integer)
Dim X As Integer
ForX=1ToLoanAmount 'instantiated when the function is called
Dim Total As Integer
Total = Total + X
Next X ' This will not generate an error because in scope
GetNumPayments = NumPayments
End Function
[Visual Basic]
Public Function GetNumPayments(ByVal LoanAmount As Integer)
Dim X As Integer 'The NumPayments declaration has been moved to
'function scope
Dim NumPayments As Integer
ForX=1ToLoanAmount
NumPayments = NumPayments + X
Next X
GetNumPayments = NumPayments
End Function
Use of Parentheses in Procedure Calls
Subroutines or functions that are not passed arguments do not
require ...
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