Microsoft Visual Basic 2010 Step by Step eBook

(Tina Meador) #1

312 Part II Programming Fundamentals


To Do This
Create a new
collection and add
members to it

Declare a variable by using the New Collection syntax. Use the Add method
to add members. For example:
Dim URLsVisited As New Collection()
URLsVisited.Add(TextBox1.Text)
Use Visual Basic
for Applications
collections in Word

If you are using Word 2007 or Word 2010, start the program, click the
Developer tab, click the Macros command, give the macro a name, click
Create, and then enter the macro code by using the Visual Basic Editor.
If you are using Word 2003, start the program, go to the Macro submenu
of the Tools menu, click the Macros command, give the macro a name,
click Create, and then enter the macro code by using the Visual Basic
Editor.
Word exposes many useful collections, including Documents and Paragraphs.
Free download pdf