00 mcfedries fm - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… ·...

36
INDEX Symbols + (addition) operator, 55 = (assignment) operator, 54 & (concatenation) operator, 56 / (division) operator, 55 = (equal to) operator, 57 ^ (exponentiation) operator, 55 >= (greater than or equal to) operator, 57 > (greater than) operator, 57 \ (integer division) operator, 55 <= (less than or equal to) operator, 57 < (less than) operator, 57 * (multiplication) operator, 55 - (negation) operator, 55 <> (not equal) operator, 57 . (period), 40 + (plus sign), 47 - (subtraction) operator, 55 _ (underscore), 66 A A1 cells, selecting on all worksheets, 158-159 Abs function, 61, 365 Accelerator property (controls), 246, 249 Access databases connections, opening, 191 data sources, creating, 191-192 object models, choosing, 190-191 overview, 189 records adding, 205-206 deleting, 207-208 editing, 203-205 finding, 202-203 navigating, 199-201 recordsets accessing recordset data, 198-199 exporting from Access to Excel, 210-212 opening with Open method, 194-196 opening with SELECT statement, 196-198 opening with tables, 193-194 overview, 192-193 references, creating, 190-191 retrieving data into Excel individual field values, 208 recordsets, 210-212 rows, 208-210 accessing recordset data, 198-199 Activate method, 88, 152 activating windows, 88 active items, 74 ActiveConnection property (Recordset object), 195 ActiveDocument object, 116 ActivePresentation object, 166 ActiveWindow object, 88 ActiveWorkbook object, 146 ActiveX Data Objects (ADO), 189-190 Add method Documents collection, 118 Names collection, 162 Presentations collection, 166 Recipients object, 226 Slides collection, 171 Workbooks collection, 147 Worksheets collection, 151

Upload: others

Post on 06-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

I N D E X

Symbols

+ (addition) operator, 55= (assignment) operator, 54& (concatenation)

operator, 56/ (division) operator, 55= (equal to) operator, 57^ (exponentiation)

operator, 55>= (greater than or equal

to) operator, 57> (greater than)

operator, 57\ (integer division)

operator, 55<= (less than or equal to)

operator, 57< (less than) operator, 57* (multiplication)

operator, 55- (negation) operator, 55<> (not equal) operator, 57. (period), 40+ (plus sign), 47- (subtraction) operator, 55_ (underscore), 66

A

A1 cells, selecting on allworksheets, 158-159

Abs function, 61, 365Accelerator property

(controls), 246, 249Access databases

connections, opening, 191data sources, creating,

191-192object models, choosing,

190-191overview, 189records

adding, 205-206deleting, 207-208editing, 203-205finding, 202-203navigating, 199-201

recordsetsaccessing recordset

data, 198-199exporting from Access

to Excel, 210-212opening with Open

method, 194-196opening with SELECT

statement, 196-198opening with tables,

193-194overview, 192-193

references, creating, 190-191

retrieving data into Excelindividual field

values, 208recordsets, 210-212rows, 208-210

accessing recordset data,198-199

Activate method, 88, 152activating windows, 88active items, 74ActiveConnection property

(Recordset object), 195ActiveDocument

object, 116ActivePresentation

object, 166ActiveWindow object, 88ActiveWorkbook

object, 146ActiveX Data Objects

(ADO), 189-190Add method

Documents collection, 118

Names collection, 162Presentations

collection, 166Recipients object, 226Slides collection, 171Workbooks

collection, 147Worksheets

collection, 151

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 371

Page 2: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

Index Add Procedure dialog box372

Add Procedure dialog box, 20

Add Watch command(Debug menu), 345

Add Watch dialog box, 345AddComment method, 176AddConnector

method, 176AddCurve method, 176AddingARecord procedure,

205-206AddItem method, 253addition operator (+), 55AddJugglingSlides

procedure, 173-174AddLabel method, 176AddLine method, 176AddMediaObject

method, 177AddNew method, 205-206AddPicture method, 177AddPolyline method, 177Address property

Range object, 163Recipient object, 226

AddShape method, 177AddTextEffect

method, 177AddTitle method, 178ADO (ActiveX Data

Objects), 189-190AdvanceMode property

(SlideShowSettingsobject), 187

AdvanceOnClick property(SlideShowTransitionobject), 186

AdvanceOnTime property(SlideShowTransitionobject), 186

AdvanceTime property(SlideShowTransitionobject), 186

ampersand (&), 56And operator, 95AnimationSettings

property (Shape object), 178

AppActivate statement, 356Appearance properties

(forms), 239Application_ItemSend

procedure, 219Application object, 73,

81, 139methods

Calculate, 140CalculateFull, 140CheckSpelling, 87CreateItem, 225Evaluate, 140-141OnKey, 142-143OnRepeat, 145-146OnTime, 144OnUndo, 145-146Wait, 141

propertiesCaption, 82Dialogs, 83-87Height, 83Left, 83ScreenUpdating, 319StatusBar, 82Top, 83UsableHeight, 83UsableWidth, 83Width, 83WindowState, 83WorksheetFunction,

139-140Application_Quit

procedure, 218Application_Reminder

procedure, 227-228

application settingsdeleting from

Registry, 307reading from Registry,

306-307reading section

settings, 309storing in Registry,

305-306Application_Startup

procedure, 218application window

properties, 82-83Apply method, 181ApplyTemplate

method, 167arguments, named, 76arithmetic operators, 55Array function, 366arrays

Array function, 366declaring, 41definition of, 40dynamic arrays, 41-43finding lower/upper

bounds of, 41-43multidimensional

arrays, 44one-dimensional

arrays, 44As keyword, 38Asc function, 64, 368AscB function, 368AscW function, 368assigning

objects to variables, 79-80shortcut keys

to Excel macros, 10-11to Word macros, 9-10

assignment operator (=), 54asterisk (*), 55Atn function, 61, 365

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 372

Page 3: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

How can we make this index more useful? Email us at [email protected]

373cbWindows_GetItemLabel procedure

Attachment object, 229attachments (email)

adding to messages, 230-231

Attachment objects, 229removing from forwarded

messages, 229-230Auto Syntax Check, 351AutoShapeType property

(Shape object), 179AutoSize property

(controls), 246

B

BackColor property(forms), 239

Background property(Slide object), 172

backing up Word documents, 122-124

backslash (\), 55BackStyle property

(controls), 246BackUpToDrive

procedure, 328-329BAS (Basic) file

format, 300BCC property (MailItem

object), 220Beep statement, 356Behavior properties

(forms), 239-240BigNumbers procedure,

105-106Body property (MailItem

object), 220BodyFormat property

(MailItem object), 220BOF property (Recordset

object), 200

Bold property (Rangeobject), 126

BoldAndItalic procedure, 145

bookmarks, navigatingrecordsets with, 201

Boolean data type, 37BorderColor property

(forms), 239BorderStyle property

(forms), 239break mode

entering, 340-342at beginning of

procedure, 340from error dialog

boxes, 340with Esc key, 341with Stop

statement, 342exiting, 342overview, 339-340

breakpoints, setting, 341btnChooseAnotherStyle_

OnAction procedure, 287btnCloseWindow_

GetEnabled procedure, 297

btnCloseWindow_OnAction procedure, 296

btnPromptToSaveChanges_OnAction procedure, 279

btnRefreshList_OnActionprocedure, 295-297

bugs. See debugging procedures

buttonscommand buttons, 249creating, 277option buttons, 250-251split buttons, 280-281toggle buttons, 282-283

Buttons parameter(MsgBox function), 46-48

ButtonTest procedure, 48ButtonTest2 procedure, 49Byte data type, 36

C

Calculate method, 140, 152CalculateAge function, 70CalculateFull method, 140Call statement, 356callbacks, 267CallByName function, 366calling user-defined

functions, 26camel-style naming

convention, 34Cancel property

(CommandButtonobject), 249

Caption propertyApplication object, 82CommandButton

object, 249controls, 247forms, 239

captions of title bars,changing, 82

caret (^), 55Case property (Range

object), 126CBool function, 362cbWindows_

GetItemCount procedure, 292-293

cbWindows_GetItemIDprocedure, 292

cbWindows_GetItemLabelprocedure, 293

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 373

Page 4: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

cbWindows_OnChangeprocedure, 296-297

CByte function, 362CC property (MailItem

object), 221CCur function, 362CDate function, 69, 362CDbl function, 362CDec function, 362cells (Excel)

returning, 154selecting

selecting A1 on allworksheets, 158-159

selecting home cell on all worksheets,159-160

selecting named rangethat contains activecell, 160-161

Cells method, 154certified signing authori-

ties, 304changing

control values, 295-297data types, 39default drive, 315default folder, 315

ChDir statement, 315, 356ChDrive statement,

315, 356check boxes

checkBox element (XML),281-282

CheckBox object, 251checking spelling, 75, 87CheckSpelling method,

75, 87chkToggleProofingErrors_

OnAction procedure, 282Choose function,

102-103, 366

Index cbWindows_OnChange procedure374

Chr function, 64, 368Chr$ function, 64, 368ChrB function, 368ChrW function, 368CInt function, 362Clear All Breakpoints

command (Debug menu), 342

Clear methodErr object, 332ListBox object, 253

CLng function, 362Close method, 76

Document object, 121MailItem object, 222Presentation object, 167Workbook object, 150

Close statement, 356CloseAllOpenDocuments

macro, 121-122closing

Excel workbooks, 150Word documents, 121-122

Code command (Viewmenu), 248

code continuation character (_), 66

Collapse method, 132collapsing selection

(Word), 132collections. See also objects

DocumentsAdd method, 118Open method, 116

elements, 78index values, 78Names, 162Presentations, 166Slides

Add method, 171InsertFromFile

method, 172

WorkbooksAdd method, 147Open method, 146-147

Worksheets, 151ColorTester

procedure, 101Column property (Range

object), 163ColumnCount property

(ListBox object), 252ColumnHeads property

(ListBox object), 252columns (Excel),

returning, 156Columns method, 156combo boxes

comboBox element(XML), 288

ComboBox object, 252command buttons, 249command macros.

See macrosCommandButton

object, 249commands (menu)

Debug menuAdd Watch, 345Clear All

Breakpoints, 342Edit Watch, 346Quick Watch, 347Run To Cursor, 343Step Into, 340, 343Step Out, 343Step Over, 343Toggle Breakpoint, 341

Edit menuComplete Word, 30Copy, 245Delete, 245List Constants, 28List Properties/

Methods, 28

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 374

Page 5: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

Parameter Info, 29Select All, 243

File menuExport File, 300Import File, 300Remove, 301

Format menuGroup, 245Ungroup, 245

Formulas menu, InsertFunction, 26

Insert menu, Procedure, 20

Macros menuRecord Macro, 5, 7Stop Recording, 7-8

Tools menu, DigitalSignature, 305

View menuCode, 248Immediate

Window, 348Tab Order, 247Watch Window, 344

commentscommenting out

statements, 351definition of, 22

comparison operators, 56-57, 80

compile errors, 338Complete Word feature

(IntelliSense), 30ConcatenateStrings

procedure, 157concatenating strings, 157concatenation operator

(&), 56configuring macro security

macro security levels, 302-304

overview, 301trusted locations, 301-302

connections (database),opening, 191

Const statement, 45, 356constants

built-in constants, 44creating, 45definition of, 28, 44listing, 28-29user-defined constants,

45, 352control structures

If...Then statementAnd operator, 95block syntax, 92example, 92-93Or operator, 95single-line syntax, 92

If...Then...Else statementexample, 93-94indenting for

readability, 94multiple

If...Then...Else statements, 95-96

syntax, 93indenting for

readability, 111loops

Do...Loop, 105-106exiting, 110For Each...Next, 109For...Next, 106-108overview, 104-105

Select Case statementFutureValue4()

example, 98LetterGrade()

example, 98-99syntax, 97VBAColor()

example, 99-101controlling order of

precedence (operators), 58-60

controlsbuttons, 277check boxes, 251combo boxes, 252command buttons, 249copying, 244-245deleting, 245frames, 243, 250grouping, 245inserting on forms,

242-243labels, 249list boxes, 252-253multipage controls,

257-258option buttons, 250-251overview, 242properties

common properties, list of, 246-247

setting, 246Ribbon controls

check boxes, 281-282combo boxes, 288common attributes,

276-277dialog box

launchers, 289drop-down lists,

284-285galleries, 285-287getting and changing

control values, 295-297

initializing, 290-293menus, 278-280resetting, 293-295split buttons, 280-281toggle buttons,

282-283scrollbars, 253selecting, 243selection handles, 243sizing, 244spin buttons, 253-254

How can we make this index more useful? Email us at [email protected]

375controls

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 375

Page 6: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

tab order, 247-248tab strips, 254-257

initializing, 256modifying controls in,

256-257text boxes, 249-250toggle buttons, 251

ControlSource property(controls), 246

ControlTipText property(controls), 247

conversion functions, 362converting strings into

objects, 140-141Copy command (Edit

menu), 245Copy method

MailItem object, 222Worksheet object, 152

CopyFromRecordsetmethod, 210

copyingcontrols, 244-245files, 315

CopyTo method, 217Cos function, 61, 365Count property

Range object, 163Sentences object, 134

counting words, 133CountWords function, 133Create Digital Certificate

dialog box, 304-305Create New Data Source

dialog box, 192CreateItem method, 225CreateJugglingPresentation

procedure, 169-170CreateObject function, 366CSng function, 362CStr function, 64, 362

CurDir function, 310, 363CurDir$ function, 363Currency data type, 37CurrentRegion property

(Range object), 163cursors, stepping to, 343CursorType property

(Recordset object), 195custom dialog boxes. See

formscustom rules (Outlook),

223-224Custom UI Editor, 270Customize Keyboard

dialog box, 9customizing Ribbon. See

Ribbon customizationCVar function, 362CVDate function, 362CVErr function, 362Cycle property

(forms), 239

D

DAO (Data AccessObjects), 190

data sources, creating, 191-192

data tips feature, 347data types

Boolean, 37Byte, 36changing, 39consistency in

expressions, 54Currency, 37data type prefixes, 38Date, 36definition of, 29

DefType keywords, 39Double, 37Integer, 36Long, 37Object, 36Single, 37specifying, 36-38String, 36user-defined data types,

39-40Variant, 37

databases. See Access databases

DataSeries method, 163Date data type, 36date expressions, 68-70Date function, 69, 362Date statement, 356Date$ function, 69, 362date/time functions, 69,

362-363DateAdd function, 69, 362DateDiff function, 69, 362DatePart function, 69, 362DateSerial function,

69, 362DateValue function,

69, 362Day function, 69, 362DayDeity function, 103DDB function, 63, 364Debug menu commands

Add Watch, 345Clear All Breakpoints, 342Edit Watch, 346Quick Watch, 347Run To Cursor, 343Step Into, 340, 343Step Out, 343Step Over, 343Toggle Breakpoint, 341

Index controls376

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 376

Page 7: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

debugging proceduresbreak mode

entering, 340-342exiting, 342overview, 339-340

breakpoints, setting, 341compile errors, 338data tips feature, 347debugging tips and

techniques, 350-352Immediate window

executing statementsin, 350

overview, 348printing data in,

348-349Locals window, 344logic errors, 339overview, 337-338Quick Watch feature, 347runtime errors, 338-339stepping into

procedures, 343stepping out of

procedures, 343stepping over

procedures, 343stepping to cursor, 343syntax errors, 338watch expressions,

344-346Declare statement, 356declaring

arraysdynamic arrays, 41-43multidimensional

arrays, 44one-dimensional

arrays, 44variables, 33-35

explicit declarations,35-36

implicit declarations, 35

default drive, changing, 315

default folders changing, 315referencing, 214

Default property(CommandButtonobject), 249

DefBool statement, 356DefByte statement, 356DefCur statement, 356DefDate statement, 356DefDbl statement, 356DefInt statement, 356DefLng statement, 356DefObj statement, 356DefSng statement, 356DefStr statement, 356DefType keywords, 39DefVar statement, 356Delete command (Edit

menu), 245Delete method

Attachment object, 229MailItem object, 222MAPIFolder object, 217Range object, 128-129Recordset object, 207Worksheet object, 152

DeleteAll procedure, 143DeleteFolder procedure,

317-318DeleteSetting statement,

307, 357deleting

application settings fromRegistry, 307

controls, 245files, 315-316folders, 316-318records, 207-208

text (Word), 128-129watch expressions, 346

DeletingARecord procedure, 207

Description property (Errobject), 330

Developer tab, displaying, 16

dialog box launchers(Ribbon), creating, 289

dialog boxes. See also formsAdd Procedure, 20Add Watch, 345Create Digital Certificate,

304-305Create New Data

Source, 192Customize Keyboard, 9displaying, 83-87Edit Watch, 346Export File, 300Import File, 300input boxes, 50-51Insert Function, 26-27Macro, 8-9, 21-22Macro Options, 11Macros, 8-9message boxes

creating, 45-46message styles, 46-48return values, 48-49

Microsoft Office SecurityOptions, 302

Modify Button, 12ODBC Microsoft Access

Setup, 192Quick Watch, 347Record Macro, 5, 7Select Certificate, 305Select Database, 192Tab Order, 247Trust Center, 302-303

dialogBoxLauncher element (XML), 289

How can we make this index more useful? Email us at [email protected]

377dialogBoxLauncher element (XML)

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 377

Page 8: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

Dialogs property(Application object), 83-87

Digital Signature command(Tools menu), 305

digital signatures, 304-305Dim statement, 33-34, 357Dir function, 310-312, 363Dir$ function, 363directories. See foldersdisabling error traps, 330Display method, 86, 222displaying

Developer tab, 16dialog boxes, 83-87forms, 258status bar messages, 82

DisplayName property(Attachment object), 229

DisplaySentenceLengthsprocedure, 134-135

Divide function, 326-327dividends, 55DivideNumbers procedure,

331-332division operator (/), 55divisors, 55dlLaunchInsertHyperlink

Dialog_OnAction procedure, 289

Do...Loop statement, 105-106, 357

DocTooLong function, 102Document object, 73, 115

Close method, 121Range method, 125Save method, 119SaveAs method, 120

documents (Word)ActiveDocument

object, 116backing up, 122-124

closingClose method, 121closing all documents,

121-122creating, 118Document object, 115Documents object, 115hiding, 319macro-enabled

documents/templates,creating, 265-267

openingwith Open

method, 116with RecentFiles

object, 116-117Paragraph object, 136-138Range object, 125

Bold property, 126Case property, 126Delete method,

128-129deleting text, 128-129Font property, 126formatting text, 126InsertAfter

method, 127InsertBefore

method, 127inserting text, 127-128InsertParagraph

method, 127InsertParagraphAfter

method, 127InsertParagraphBefore

method, 127InsertParagraphsAnd

Text procedure, 127-128

Italic property, 126reading and changing

range text, 126returning with Range

method, 125returning with Range

property, 125

saving, 118Save method, 119SaveAs method, 120

Selection objectCollapse method, 132collapsing

selection, 132creating, 129extending selection,

131-132MoveEnd method, 130MoveStart method, 130moving insertion

point, 130overview, 129Type property, 129

Sentences object, 133-135ThisDocument

object, 116word count, testing, 102Words object, 132-133

documents (XML). See alsoRibbonX

elementscheckBox, 281comboBox, 288dialogBoxLauncher,

289dropdown, 284gallery, 285-287group, 274-275menu, 278Relationship, 265, 269ribbon, 271splitButton, 280tab, 272-273tabs, 271toggleButton, 282-283

MyRibbon.xml fileadding to document

package, 268-269creating, 267-268renaming and

opening, 269Documents collection

Add method, 118Open method, 116

Index Dialogs property (Application object)378

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 378

Page 9: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

Documents object, 73, 115DoEvents function, 366DoNotSaveChanges_

OnAction procedure, 279Double data type, 37drives, changing default

drive, 315drop-down lists (Ribbon),

creating, 284-285dropdown element

(XML), 284Duplicate method, 181dynamic arrays, 41-43

E

Edit menu commandsComplete Word, 30Copy, 245Delete, 245List Constants, 28List Properties/

Methods, 28Parameter Info, 29Select All, 243

Edit Watch command(Debug menu), 346

Edit Watch dialog box, 346editing

range text (Word), 126records, 203-205watch expressions, 346

EditingARecord procedure, 204

editorsCustom UI Editor, 270Visual Basic Editor

creating modules, 17-18

displaying, 16opening modules,

18-19shutting down, 30

elements (XML)checkBox, 281comboBox, 288dialogBoxLauncher, 289dropdown, 284gallery, 285-287group, 274-275menu, 278Relationship, 265, 269ribbon, 271splitButton, 280tab, 272-273tabs, 271toggleButton, 282-283

email (Outlook)attachments

adding to messages,230-231

Attachment objects, 229

removing from forwarded messages,229-230

custom rules, 223-224folders

listing all folders, 214-215

methods, 217prompting users for,

216-217referencing default

folders, 214incoming message

handling, 217AddItem event,

218-219custom rules, 223-224spam, 224-225

MailItem objectmethods, 221-223properties, 220-221

messagescreating, 225forwarding, 225replying to, 225sending, 226-227

specifying messagerecipients, 226

supplementingreminders with emailmessages, 227-228

NameSpace object, 213Folders property, 214Logoff method,

233-234Logon method, 232PickFolder method,

216-217outgoing message

handling, 219-220overview, 213sessions

logging off, 233-234logging on, 232

enabled attribute (controls), 277

Enabled property (forms), 240

End statement, 357EndingSlide property

(SlideShowSettingsobject), 187

EnterFieldBehavior property (TextBoxobject), 249

EnterKeyBehavior property (TextBoxobject), 250

Enum statement, 357Environ function, 366EOF function, 363EOF property (Recordset

object), 200equals sign (=), 54, 57Erase statement, 357Err object

methods, 332-333overview, 330properties, 330-332

How can we make this index more useful? Email us at [email protected]

379Err object

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 379

Page 10: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

Error function, 363error handlers, 325-327Error statement, 357Error$ function, 363error-trapping

disabling traps, 330Err object

methods, 332-333overflow errors, 330overview, 330properties, 330-332type mismatch

errors, 330error handlers,

325-327, 363On Error GoTo

statement, 325On Error Resume Next

statement, 324overview, 323-324Resume statement,

327-329trappable VBA errors,

table of, 333-335errors

compile errors, 338Err object

methods, 332-333overview, 330properties, 330-332

error handlers, 325-327logic errors, 339overflow, 330runtime errors, 338-339syntax errors, 338trapping

disabling traps, 330error handlers, 325-327On Error GoTo

statement, 325On Error Resume Next

statement, 324overview, 323-324

Resume statement,327-329

trappable VBA errors,table of, 333-335

type mismatch, 330variable errors,

avoiding, 35-36Esc key, entering break

mode, 341Evaluate method, 140-141EvaluateTest

procedure, 141event handlers, 77-78, 248Event statement, 357events

definition of, 77event handlers, 77-78, 248ItemAdd, 218-219ItemSend, 219-220

ExcelApplication object, 139

Calculate method, 140CalculateFull

method, 140Evaluate method,

140-141OnKey method,

142-143OnRepeat method,

145-146OnTime method, 144OnUndo method,

145-146Wait method, 141WorksheetFunction

property, 139-140cells

returning, 154selecting, 158-161

columns, returning, 156importing Access data into

individual field values, 208

recordsets, 210-212rows, 208-210

macrosPersonal Macro

Workbook, 7pausing, 141recording, 7-8shortcut keys, 10-11

objects, converting stringsinto, 140-141

proceduresassigning keyboard

shortcuts to, 142-143running at specific

times, 144running when user

selects Repeat orUndo, 144-146

Range object, 153defining range

names, 162inserting data into

ranges, 162-163resizing ranges,

163-164returning data about

ranges, 163returning with Cells

method, 154returning with

Columns method, 156returning with Offset

method, 157-158returning with Range

method, 153-154returning with Rows

method, 155-156selecting ranges,

158-161rows, returning, 155-156user-defined functions,

entering, 26-27workbooks

ActiveWorkbookobjects, 146

closing, 150creating, 147opening, 146-147recalculating, 140

Index Error function380

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 380

Page 11: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

saving, 148-149specifying number of

sheets in, 147-148ThisWorkbook

objects, 146Workbook object, 146

Worksheet object, 150accessing worksheet

functions, 139-140creating

worksheets, 151methods, 152-153properties, 151-152specifying, 150-151

Execute method, 86-87executing statements in

Immediate window, 350Exit Do statement, 110Exit For statement, 110Exit statement, 357exiting

break mode, 342loops, 110

Exp function, 61, 365explicit declarations, 35-36exponential notation, 37exponentiation

operator (^), 55Export File command (File

menu), 300Export File dialog box, 300exporting modules, 300expressions

data type consistency, 54date expressions, 68-70definition of, 24, 53logical expressions, 66-67numeric expressions

financial functions, 62-63

math functions, 60-62overview, 60

operands, 54operators

arithmetic operators, 55

assignment (=), 54comparison operators,

56-57concatenation, 56definition of, 54logical operators,

57, 67order of precedence,

57-60overview, 53-54string expressions, 63-66

extending selection(Word), 131-132

extensibility of Ribbon,263-265

ExtractLastName function, 65

F

field values, exporting fromAccess to Excel, 208

Fields property (Recordsetobject), 198

File menu commandsExport File, 300Import File, 300Remove, 301

file systemdefault drive,

changing, 315file/folder information,

returningCurDir function, 310Dir function, 310-312FileDateTime function,

312

FileLen function, 312-313

GetAttr function, 313-314

filescopying, 315deleting, 315-316file/directory functions,

363-364renaming, 316setting attributes

of, 318tracking file usage,

307-309folders

changing default folder, 315

creating, 316deleting, 316-318renaming, 316setting attributes

of, 318FileAttr function, 364FileCopy statement,

315, 357FileDateTime function,

312, 364FileLen function,

312-313, 364FileName property

(Attachment object), 229files. See also file system

copying, 315deleting, 315-316file/directory functions,

363-364inserting slides from, 172MyRibbon.xml file

adding to documentpackage, 268-269

creating, 267-268renaming and

opening, 269

How can we make this index more useful? Email us at [email protected]

381files

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 381

Page 12: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

renaming, 316returning file/folder

informationCurDir function, 310Dir function, 310-312FileDateTime

function, 312FileLen function,

312-313GetAttr function,

313-314setting attributes of, 318tracking file usage,

307-309Fill property (Shape

object), 179Filter function, 368financial functions, 62-63,

364-365Find method, 202finding records, 202-203Fix function, 61, 365FlagRequest property

(MailItem object), 221Flip method, 182fmPictureSizeModeClip

value (PictureSizeModeproperty), 241

fmPictureSizeModeStretchvalue (PictureSizeModeproperty), 241

fmPictureSizeModeZoomvalue (PictureSizeModeproperty), 241

focus, 74folders

changing default folder, 315

creating, 316deleting, 316-318

Outlook folderslisting all folders,

214-215methods, 217prompting users for,

216-217referencing default

folders, 214renaming, 316returning file/folder

information, 310CurDir function, 310Dir function, 310-312FileDateTime

function, 312FileLen function,

312-313GetAttr function,

313-314setting attributes of, 318

Folders property(NameSpace object), 214

FollowMasterBackgroundproperty (Slide object), 173

Font propertyforms, 240Range object, 126

For Each...Next statement,109, 357

For...Next statement, 106-108, 357

ForeColor property(forms), 239

Format function, 64, 366Format menu

commands, 245Format$ function, 64, 366FormatCurrency function,

64, 366FormatDateTime function,

64, 366

FormatFirstParagraph procedure, 131-132

FormatNumber function, 366

FormatParagraph procedure, 80-81

FormatParagraph2 procedure, 81

FormatPercent function,64, 366

formatting text (Word), 126

formsadding to projects, 238controls

check boxes, 251combo boxes, 252command buttons, 249copying, 244-245deleting, 245frames, 243, 250grouping, 245inserting, 242-243labels, 249list boxes, 252-253multipage controls,

257-258option buttons,

250-251overview, 242properties, 246-247scrollbars, 253selecting, 243selection handles, 243sizing, 244spin buttons, 253-254tab order, 247-248tab strips, 254-257text boxes, 249-250toggle buttons, 251

displaying, 258event handlers, 248overview, 237-238processing, 259-262

Index files382

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 382

Page 13: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

propertiesAppearance

category, 239Behavior category,

239-240Font category, 240Misc category, 240-241Picture category, 241Position category, 241Scrolling category,

241-242unloading, 258-259

Formulas menu commands, InsertFunction, 26

Forward method, 225ForwardAndDelete

Attachments procedure,229-230

forwarding email, 225Frame object, 250frames, 243, 250FreeFile function, 364FullName property

(Presentation object), 166Function statement,

38, 357Function wizard, 26-27functions. See also

methods; procedures;statements

Abs, 61, 365accessing worksheet

functions, 139-140Array, 366Asc, 64, 368AscB, 368AscW, 368Atn, 61, 365CalculateAge, 70CallByName, 366CBool, 362CByte, 362

CCur, 362CDate, 69, 362CDbl, 362CDec, 362ChDir, 315, 356ChDrive, 315, 356Choose, 102-103, 366Chr, 64, 368Chr$, 64, 368ChrB, 368ChrW, 368CInt, 362CLng, 362Cos, 61, 365CountWords, 133CreateObject, 366CSng, 362CStr, 64, 362CurDir, 310, 363CurDir$, 363CVar, 362CVDate, 362CVErr, 362Date, 69, 362Date$, 69, 362DateAdd, 69, 362DateDiff, 69, 362DatePart, 69, 362DateSerial, 69, 362DateValue, 69, 362Day, 69, 362DayDeity, 103DDB, 63, 364Dir, 310-312, 363Dir$, 363Divide, 326-327DocTooLong, 102DoEvents, 366Environ, 366EOF, 363Error, 363Error$, 363Exp, 61, 365ExtractLastName, 65FileAttr, 364FileDateTime, 312, 364

FileLen, 312-313, 364Filter, 368financial functions, 62-63Fix, 61, 365Format, 64, 366Format$, 64, 366FormatCurrency, 64, 366FormatDateTime, 64, 366FormatNumber, 366FormatPercent, 64, 366FreeFile, 364Function wizard, 26-27FutureValue, 94FutureValue2, 95FutureValue3, 96FutureValue4, 98fv, 62-63, 364GetAllSettings, 309, 366GetAttr, 313-314, 364GetObject, 366GetRangeName, 160-161GetSetting, 306-307, 366GrossMargin, 26, 35GrossMargin2, 92Hex, 61, 365Hex$, 61, 365Hour, 69, 362IIf, 101-102, 366Input, 366Input$, 367InputB, 367InputB$, 367InputBox, 50-51, 367InStr, 64, 368InStrB, 368InStrRev, 64, 368Int, 61, 365IPmt, 63, 364IRR, 63, 364IsArray, 367IsDate, 367IsEmpty, 367IsError, 367IsMissing, 367IsNull, 367IsNumeric, 367

How can we make this index more useful? Email us at [email protected]

383functions

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 383

Page 14: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

IsObject, 367Join, 368LBound, 43, 367LCase, 64, 100, 368LCase$, 64, 368Left, 64, 368Left$, 64, 368LeftB, 369LeftB$, 369Len, 64, 369LenB, 369LetterGrade, 98LetterGrade2, 104Loc, 364LOF, 364Log, 61, 365LTrim, 64, 369LTrim$, 64, 369math functions, 60-62Mid, 64, 369Mid$, 64, 66, 369MidB, 369MidB$, 369Minute, 69, 362MIRR, 63, 364Month, 69, 362MonthName, 69, 362MsgBox, 21, 329, 367

Buttons parameter, 46-48return values, 48-49syntax, 45-46

Now, 69, 363nper, 62-63, 364NPV, 63, 364Oct, 61, 365Oct$, 61, 365Partition, 367Pmt, 29, 62-63, 364PPmt, 63, 365pv, 62-63, 365QBColor, 367rate, 62-63, 365Replace, 64, 369RGB, 80, 99, 367Right, 65, 369Right$, 65, 369

RightB, 369RightB$, 369Rnd, 61, 365Round, 365RTrim, 65, 369RTrim$, 65, 369Second, 69, 363Seek, 364Sgn, 61, 365Shell, 364Sin, 61, 365SLN, 63, 365Space, 65, 369Space$, 65, 369Split, 370Sqr, 61, 366Str, 65, 370Str$, 65, 370StrComp, 65, 370StrConv, 65String, 65, 370String$, 65, 370StrReverse, 370Switch, 103-104, 367SYD, 63, 365Tab, 367Tan, 61, 366Time, 69, 363Time$, 69, 363Timer, 69, 363TimeSerial, 69, 363TimeValue, 69, 144, 363Trim, 65, 100, 370Trim$, 65, 370type, 62TypeName, 367UBound, 43, 367UCase, 65, 140, 370UCase$, 65, 370user-defined functions

calling, 26definition of, 19, 24entering into cells,

26-27expressions, 24structure, 24writing, 25

Val, 65, 370VarType, 367VBAColor, 100Weekday, 69, 363WeekdayName, 69, 363Year, 69, 363

FutureValue function, 94FutureValue2 function, 95FutureValue3 function, 96FutureValue4 function, 98fv function, 62-63, 364

G

galInsertHyperlinksFor_OnAction procedure, 287

galleries (Ribbon), creating, 285-287

gallery element (XML),285-287

Get statement, 357GetAllChapter14Settings

procedure, 309GetAllSettings function,

309, 366GetAttr function,

313-314, 364GetAttributes

procedure, 314GetDefaultFolder

method, 214getEnabled callback

attribute, 291GetFilenames

procedure, 311-312GetFolderUsage

procedure, 312-313getImageMso callback

attribute, 291getKeyTip callback

attribute, 291

Index functions384

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 384

Page 15: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

getLabel callback attribute, 291

GetNumbers procedure, 326

GetObject function, 366getPressed callback

attribute, 291GetRangeName function,

160-161GetRows method, 208getScreentip callback

attribute, 291getSelectedItemID

callback attribute, 291getSelectedItemIndex

callback attribute, 291getSelectedItemIndex

method, 291GetSetting statement,

306-307, 366getShowLabel callback

attribute, 291getSize callback

attribute, 291getSupertip callback

attribute, 291getVisible callback

attribute, 291GoSub...Return

statement, 357GoTo statement, 357GoToNextSentence

procedure, 130greater than

operator (>), 57greater than or equal to

operator (>=), 57GrossMargin function,

26, 35GrossMargin2 function, 92

Group command (Formatmenu), 245

group element (XML),274-275

grouping controls, 245groups (Ribbon)

creating, 274customizing, 274-275

H

hard-coding, 45HasTextFrame property

(Shape object), 179Height property

Application object, 83forms, 241Shape object, 179

help. See IntelliSenseHex function, 61, 365Hex$ function, 61, 365hiding

built-in Ribbon, 270-271documents, 319

hierarchy of objects, 73home cells, selecting,

159-160Hopper, Grace, 337Hour function, 69, 362HTMLBody property

(MailItem object), 221hyperlinks, inserting,

136-137

I

id attribute (controls), 276IDE (integrated

development environment), 17

idMso attribute (controls), 276

If...Then statementAnd operator, 95block syntax, 92example, 92-93Or operator, 95single-line syntax, 92

If...Then...Else statement, 357

example, 93-94indenting for

readability, 94multiple If...Then...Else

statements, 95-96syntax, 93

IIf function, 101-102, 366imageMso attribute

(controls), 276Immediate window

executing statements in, 350

overview, 348printing data in, 348-349

Immediate Window command (View menu), 348

Implements statement, 357implicit declarations, 35Import File command (File

menu), 300Import File dialog box, 300Importance property

(MailItem object), 221importing modules, 300inboxItems_ItemAdd

procedure, 219, 223-224incoming messages,

handling (Outlook)AddItem event, 218-219custom rules, 223-224spam, 224-225

IncrementLeft method, 182

How can we make this index more useful? Email us at [email protected]

385IncrementLeft method

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 385

Page 16: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

IncrementRotationmethod, 182

IncrementTop method, 182

indenting for readability,111, 350

index values (collections), 78

initializingcontrols, 290-293tab strips, 256

input boxes, 50-51Input function, 366Input statement, 357Input$ function, 367InputB function, 367InputB$ function, 367InputBox function,

50-51, 367InputBoxTest

procedure, 51Insert Function command

(Formulas menu), 26Insert Function dialog

box, 26-27Insert menu commands,

Procedure, 20InsertAfter method, 127InsertAfterMso attribute

(controls), 276InsertAndRedefineName

procedure, 164InsertBefore method, 127InsertBeforeMsoID

attribute (controls), 276InsertFromFile

method, 172InsertHyperlinks

procedure, 136-137

insertingcontrols on forms,

242-243hyperlinks (Word),

136-137records, 205-206text (Word), 127-128

insertion point (Word),moving, 130

InsertParagraph method, 127

InsertParagraphAftermethod, 127

InsertParagraphBeforemethod, 127

InsertParagraphsAndTextprocedure, 127-128

InStr function, 64, 368InStrB function, 368InStrRev function, 64, 368Int function, 61, 365Integer data type, 36integer division

operator (\), 55integrated development

environment (IDE), 17IntelliSense

Complete Word feature, 30

List Constants feature, 28-29

List Properties/Methodsfeature, 27-28

Parameter Info feature,29-30

Invalidate method, 294InvalidateControl

method, 294IPmt function, 63, 364IRR function, 63, 364Is operator, 80

IsArray function, 367IsDate function, 367IsEmpty function, 367IsError function, 367IsMissing function, 367IsNull function, 367IsNumeric function, 367IsObject function, 367Italic property (Range

object), 126ItemAdd event, 218-219ItemSend event, 219-220

J

Join function, 368Juggling presentation, 168

AddJugglingSlides procedure, 173-174

CreateJugglingPresentation procedure, 169-170

Main procedure, 169RunJugglingSlideShow

procedure, 187-188SetUpJugglingSlides

procedure, 183-185SetUpStartPage

procedure, 180-181

K

KeepScrollBarsVisibleproperty (forms), 241

keyboard shortcutsassigning to Excel

macros, 10-11assigning to

procedures, 142-143assigning to Word

macros, 9-10keytip attribute

(controls), 277

Index IncrementRotation method386

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 386

Page 17: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

keywords. See alsofunctions; methods; procedures; statements

As, 38entering in lowercase, 351Type, 40

Kill statement, 315-316, 357

L

label attribute (controls), 276

Label object, 249LargeChange property

(ScrollBar object), 253LaunchInsertHyperlink

Dialog macro, 289Layout property (Slide

object), 173LBound function, 43, 367LCase function, 64,

100, 368LCase$ function, 64, 368Left function, 64, 368Left property

Application object, 83forms, 241Shape object, 179

Left$ function, 64, 368LeftB function, 369LeftB$ function, 369Len function, 64, 369LenB function, 369less than operator (<), 57less than or equal to

operator (<=), 57Let statement, 357LetterGrade function, 98LetterGrade2

function, 104

Line Input statement, 357list boxes, 252-253List Constants feature

(IntelliSense), 28-29List Properties/Methods

feature (IntelliSense), 27-28

ListBox object, 252-253ListFolders procedure,

215-216listing

constants, 28Outlook folders, 214-215properties/methods, 27-28

ListRows property(ComboBox object), 252

lists, Macro Name list, 8Load statement, 258, 357Loc function, 364Locals window, 344locations, trusted, 301-302Lock statement, 357Locked property

(controls), 247LockType property

(Recordset object), 195LOF function, 364Log function, 61, 365logging off Outlook

sessions, 233-234logging on to Outlook

sessions, 232logic errors, 339logical expressions, 66-67logical operators

And, 67Not, 67Or, 67table of, 57Xor, 67

Logoff method, 233-234Logon method, 232Long data type, 37loops

Do...Loop, 105-106, 357exiting, 110For Each...Next, 109, 357For...Next, 106-108, 357If...Then...Else, 357optimizing, 320-321overview, 104-105While...Wend, 359

LoopTest procedure, 107LoopUntilStopped

property (SlideShowSettings object), 187

lower bounds of arrays,returning, 41-43

LSet statement, 358lstInsertHyperlinksFor_

GetSelectedItemIndexprocedure, 291

lstInsertHyperlinksFor_OnAction procedure, 285

LTrim function, 64, 369LTrim$ function, 64, 369

M

Macro dialog box, 8-9, 21-22

Macro Name list, 8Macro Options dialog

box, 11macro-enabled

documents/templates,creating, 265-267

macros. See also proceduresassigning keyboard

shortcuts to, 142-143CloseAllOpenDocuments,

121-122

How can we make this index more useful? Email us at [email protected]

387macros

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 387

Page 18: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

debugging. See debuggingprocedures

definition of, xviii, 19Excel macros

Personal MacroWorkbook, 7

recording, 7-8shortcut keys, 10-11

LaunchInsertHyperlinkDialog, 289

Macro Name list, 8macro statements, xviiinaming, 20pausing, 141Quick Access toolbar

buttons, 11-13recording

Excel macros, 7-8overview, 3Word macros, 5-7

running, 21-22at specific times, 144when user selects

Repeat or Undo, 144-146

securitymacro security levels,

302-304overview, 301trusted locations,

301-302shortcut keys

assigning to Excelmacros, 10-11

assigning to Wordmacros, 9-10

when to use, 4Word macros

recording, 5-7shortcut keys, 9-10

writingadvantages of, 15creating modules,

17-18Developer tab,

displaying, 16

entering VBA statements, 22-23

example, 20-21opening modules,

18-19Visual Basic Editor,

displaying, 16Macros dialog box, 8-9Macros menu commands

Record Macro, 5, 7Stop Recording, 7-8

MailItem objectmethods, 221-223properties, 220-221

Main procedure (Jugglingpresentation), 169

MakeBackup procedure,122-124

MAPIFolder objectslisting, 214-215methods, 217prompting users for,

216-217referencing, 214

Master property (Slideobject), 173

MatchRequired property(ComboBox object), 252

math functions, 60-62,365-366

matrices, 44Max property (ScrollBar

object), 253MaxLength property

(TextBox object), 250menu element (XML), 278menus (Ribbon), creating,

278-280message boxes

creating, 45-48message styles, 46-48return values, 48-49

messages (Outlook)attachments

adding to messages,230-231

Attachment objects, 229

removing from forwarded messages,229-230

creating, 225forwarding, 225incoming message

handling, 217AddItem event,

218-219custom rules, 223-224spam, 224-225

outgoing message handling, 219-220

replying to, 225sending, 226-227specifying message

recipients, 226supplementing reminders

with email messages,227-228

methods. See alsofunctions; procedures;statements

Activate, 88, 152Add

Documents collection, 118

Names collection, 162Presentations

collection, 166Recipients object, 226Slides collection, 171Workbooks

collection, 147Worksheets

collection, 151AddComment, 176AddConnector, 176AddCurve, 176AddItem, 253

Index macros388

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 388

Page 19: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

AddLabel, 176AddLine, 176AddMediaObject, 177AddNew, 205-206AddPicture, 177AddPolyline, 177AddShape, 177AddTextEffect, 177AddTitle, 178Apply, 181ApplyTemplate, 167Calculate, 140, 152CalculateFull, 140Cells, 154CheckSpelling, 75, 87Clear

Err object, 332ListBox object, 253

Close, 76Document object, 121MailItem object, 222Presentation

object, 167Workbook object, 150

Collapse, 132Columns, 156Copy

MailItem object, 222Worksheet object, 152

CopyFromRecordset, 210CopyTo, 217CreateItem, 225DataSeries, 163Delete

Attachment object, 229MailItem object, 222MAPIFolder

object, 217Range object, 128-129Recordset object, 207Worksheet object, 152

Display, 86, 222Duplicate, 181Evaluate, 140-141Execute, 86-87Find, 202

Flip, 182Forward, 225GetDefaultFolder, 214GetRows, 208getSelectedItemIndex, 291IncrementLeft, 182IncrementRotation, 182IncrementTop, 182InsertAfter, 127InsertBefore, 127InsertFromFile, 172InsertParagraph, 127InsertParagraphAfter, 127InsertParagraph

Before, 127Invalidate, 294InvalidateControl, 294listing, 27-28Logoff, 233-234Logon, 232Move

MailItem object, 222Recordset object, 200Worksheet object, 152

MoveEnd, 130MoveFirst, 200MoveLast, 200MoveNext, 200MovePrevious, 200MoveStart, 130MoveTo, 217multiple methods, 80-81named arguments, 76NewWindow, 88Offset, 157-158OnKey, 142-143OnRepeat, 145-146OnTime, 144OnUndo, 145-146Open

Documents collection, 116

Presentations collection, 166

properties, 195

Recordset object, 193-196

Workbooks collection,146-147

overview, 75-77PickFolder, 216-217PickUp, 182Print, 348-349PrintOut, 167-168Raise, 333Range, 125, 153-154,

171, 175RemoveItem, 253Reply, 225ReplyAll, 225Resize, 163Rows, 155-156Run, 187-188Save

Document object, 119Presentation

object, 168SaveAs

Attachment object, 229Document object, 120Presentation

object, 168Select, 129, 182Show, 85Sort, 75syntax, 75-76Update, 204Wait, 104, 141

Microsoft Office SecurityOptions dialog box, 302

Microsoft Root CertificateProgram, 304

Mid function, 64, 369Mid$ function, 64, 66, 369MidB function, 369MidB$ function, 369Min property (ScrollBar

object), 253

How can we make this index more useful? Email us at [email protected]

389Min property (ScrollBar object)

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 389

Page 20: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

Minute function, 69, 362MIRR function, 63, 364Misc properties (forms),

240-241MkDir statement, 316, 358mnuCloseDocument2_

OnAction procedure, 280Mod operator, 55Modify Button dialog

box, 12modular programming, 104modules

creating, 17-18exporting, 300importing, 300opening, 18-19removing, 301renaming, 299-300

modulus operator, 55monitoring procedure

valuesdata tips feature, 347Locals window, 344Quick Watch feature, 347watch expressions,

344-346Month function, 69, 362MonthName function,

69, 362Move method

MailItem object, 222Recordset object, 200Worksheet object, 152

MoveEnd method, 130MoveFirst method, 200MoveLast method, 200MoveNext method, 200MovePrevious method, 200MoveStart method, 130MoveTo method, 217

MsgBox function, 21, 329, 367

Buttons parameter, 46-48return values, 48-49syntax, 45-46

multidimensional arrays, 44

MultiLine property(TextBox object), 250

multipage controls, 257-258

MultiPage object, 257-258multiple If...Then...Else

statements, 95-96multiplication

operator (*), 55MultiSelect property

(ListBox object), 252MyRibbon.xml file

adding to document package, 268-269

creating, 267-268renaming and

opening, 269

N

Name propertyforms, 240Presentation object, 167Recipient object, 226Shape object, 179Slide object, 173Worksheet object, 151

Name statement, 316, 358named arguments, 76named ranges containing

active cell, selecting, 160-161

namesExcel range names,

defining, 162macro names, 20

module names, 299-300range names, 352variable names, 34

Names collection, 162NameSpace object, 213

Folders property, 214Logoff method, 233-234Logon method, 232PickFolder method,

216-217navigating records,

199-201negation operator (-), 55NewWindow method, 88NewWorkbookWithCustom

Sheets procedure, 148not equal operator (<>), 57Not operator, 57Now function, 69, 363nper function, 62-63, 364NPV function, 63, 364Number property (Err

object), 330numbers

random numbers, generating, 61-62

serial numbers, 68numeric expressions

financial functions, 62-63math functions, 60-62overview, 60

O

Object Browser, 84Object data type, 36object hierarchy, 73object models,

choosing, 190-191

Index Minute function390

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 390

Page 21: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

objects. See also collectionsActiveDocument, 116ActivePresentation, 166ActiveWindow, 88ActiveWorkbook, 146ADO (ActiveX Data

Objects), 189Application, 73, 81, 139

Calculate method, 140CalculateFull

method, 140Caption property, 82CheckSpelling

method, 87CreateItem

method, 225Dialogs property, 83-87Evaluate method,

140-141Height property, 83Left property, 83OnKey method,

142-143OnRepeat method,

145-146OnTime method, 144OnUndo method,

145-146StatusBar property, 82Top property, 83UsableHeight

property, 83UsableWidth

property, 83Wait method, 141Width property, 83WindowState

property, 83WorksheetFunction

property, 139-140assigning to variables,

79-80Attachment, 229CheckBox, 251ComboBox, 252

CommandButton, 249comparing with Is

operator, 80converting strings

into, 140-141DAO (Data Access

Objects), 190definition of, 71Document, 73, 115

Close method, 121Range method, 125Save method, 119SaveAs method, 120

Documents, 73, 115Err

methods, 332-333overview, 330properties, 330-332

eventsdefinition of, 77event handlers, 77-78

Frame, 250Label, 249ListBox, 252-253MailItem

methods, 221-223properties, 220-221

MAPIFolderlisting, 214-215methods, 217prompting users for,

216-217referencing, 214

methods. See also specificmethods

multiple methods, 80-81

named arguments, 76overview, 75-77syntax, 75-76

MultiPage, 257-258NameSpace, 213

Folders property, 214Logoff method,

233-234

Logon method, 232PickFolder method,

216-217Object Browser, 84object hierarchy, 73OptionButton, 250-251Options, 73overview, 71-73Paragraph, 136-138Presentation

methods, 167-168properties, 166-167SlideShowSettings

property, 187specifying, 165-166

Presentations, 165properties

multiple properties, 80-81

overview, 74referencing, 73returning value of, 75setting value of, 75

Range (Word)Bold property, 126Case property, 126Delete method,

128-129deleting text, 128-129Font property, 126formatting text, 126InsertAfter

method, 127InsertBefore

method, 127inserting text, 127-128InsertParagraph

method, 127InsertParagraphAfter

method, 127InsertParagraphBefore

method, 127InsertParagraphsAnd

Text procedure, 127-128

Italic property, 126

How can we make this index more useful? Email us at [email protected]

391objects

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 391

Page 22: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

reading and changingrange text, 126

returning with Rangemethod, 125

returning with Rangeproperty, 125

Range (Excel)defining range

names, 162inserting data into

ranges, 162-163resizing ranges,

163-164returning data about

ranges, 163returning with Cells

method, 154returning with

Columns method, 156returning with Offset

method, 157-158returning with Range

method, 153-154returning with Rows

method, 155-156selecting, 158-161

RecentFiles, 73, 116-117Recipients, 226Recordset

accessing recordsetdata, 198-199

adding records, 205-206

AddNew method, 205-206

BOF property, 200Delete method, 207deleting records,

207-208editing records,

203-205EOF property, 200Fields property, 198Find method, 202finding records,

202-203

GetRows method, 208Move method, 200MoveFirst method, 200MoveLast method, 200MoveNext

method, 200MovePrevious

method, 200navigating records,

199-201Open method, 193-195opening with Open

method, 194-196opening with SELECT

statement, 196-198opening with tables,

193-194overview, 192-193Update method, 204

ScrollBar, 253Selection

Collapse method, 132collapsing

selection, 132creating, 129extending selection,

131-132MoveEnd method, 130MoveStart method, 130moving insertion

point, 130overview, 129Type property, 129

Sentences, 133-135Shape

adding to slides, 175-178

methods, 176-178,181-182

properties, 178-180specifying, 174-175

Slideadding to

presentations, 171methods, 171, 174

properties, 172-173specifying, 170-171

SlideShowSettings, 187SlideShowTransitions, 186SpinButton, 253-254TabStrip, 254-257

initializing, 256modifying controls

in, 256-257TextBox, 249-250ThisDocument, 116ThisWorkbook, 146ToggleButton, 251Window, 88Words, 132-133Workbook

closing workbooks, 150creating

workbooks, 147opening workbooks,

146-147saving workbooks,

148-149specifying number of

worksheets, 147-148Workbooks, 146Worksheet

creating worksheets, 151

methods, 152-153properties, 151-152specifying, 150-151

Oct function, 61, 365Oct$ function, 61, 365ODBC Microsoft Access

Setup dialog box, 192Office 2007 Ribbon.

See Ribbon customizationOffset method, 157-158On Error GoTo

statement, 325On Error Resume Next

statement, 324On Error statement, 358

Index objects392

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 392

Page 23: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

On...GoSub, On...GoTostatement, 358

onAction attribute (controls), 276

one-dimensional arrays, 44OnKey method, 142-143OnRepeat method,

145-146OnTime method, 144OnUndo method, 145-146Open method

Documents collection, 116

Presentations collection, 166

properties, 195Recordset object, 193-196Workbooks collection,

146-147Open statement, 358opening

database connections, 191Excel workbooks, 146-147modules, 18-19PowerPoint

presentations, 166recordsets, 192-193

with Open method,194-196

with SELECT statement, 196-198

with tables, 193-194windows, 88Word documents

with Open method, 116

with RecentFilesobject, 116-117

operands, 54operators

And, 95arithmetic operators, 55assignment (=), 54

comparison operators, 56-57, 80

concatenation, 56definition of, 54logical operators

And, 67Not, 67Or, 67table of, 57Xor, 67

Or, 95order of precedence,

57-58controlling, 58-60table of, 58

optimizing proceduresavoiding data

selection, 319avoiding

recalculation, 319hiding documents, 319loops, 320-321turning off screen

updating, 319Option Base 0|1

statement, 358option buttons, 250-251Option Compare

Text|Binary statement, 358

Option Explicit statement, 351, 358

Option Private statement, 358

OptionButton object, 250-251

Options object, 73Or operator, 95order of precedence

(operators), 57-58controlling, 58-60table of, 58

outgoing messages, handling (Outlook), 219-220

Outlookattachments

adding to messages,230-231

Attachment objects, 229

removing from forwarded messages, 229-230

custom rules, 223-224folders

listing all folders, 214-215

methods, 217prompting users for,

216-217referencing default

folders, 214incoming message

handling, 217AddItem event,

218-219custom rules, 223-224spam, 224-225

logging off, 233-234logging on, 232MailItem object

methods, 221-223properties, 220-221

messagescreating, 225forwarding, 225replying to, 225sending, 226-227specifying message

recipients, 226supplementing

reminders with emailmessages, 227-228

NameSpace object, 213Folders property, 214Logoff method,

233-234

How can we make this index more useful? Email us at [email protected]

393Outlook

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 393

Page 24: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

Logon method, 232PickFolder method,

216-217outgoing message

handling, 219-220overview, 213referencing from other

applications, 231overflow errors, 330

P

Paragraph object, 136-138Parameter Info feature

(IntelliSense), 29-30parameters, displaying

information about, 29-30Partition function, 367PasswordChar property

(TextBox object), 250Path property

(Presentation object), 167pausing procedures, 141

breakpoints, setting, 341entering break mode

at beginning of procedure, 340

from error dialogboxes, 340

with Esc key, 341with Stop

statement, 342exiting break mode, 342overview, 339-340

PerformCalculations procedure, 42

period (.), 40Personal Macro

Workbook, 7PickFolder method,

216-217PickUp method, 182

Picture properties (forms), 241

PictureAlignment property(forms), 241

PictureSizeMode property(forms), 241

PictureTiling property(forms), 241

plus sign (+), 47, 55Pmt function, 29,

62-63, 364Position properties

(forms), 241PowerPoint

presentations, 165creating, 166Juggling presentation, 168

AddJugglingSlides procedure, 173-174

CreateJugglingPresentation proce-dure, 169-170

Main procedure, 169RunJugglingSlideShow

procedure, 187-188SetUpJugglingSlides

procedure, 183-185SetUpStartPage

procedure, 180-181opening, 166Presentation object

methods, 167-168properties, 166-167SlideShowSettings

property, 187specifying, 165-166

Presentations collection, 166

shapesadding to slides,

175-178methods, 176-178,

181-182properties, 178-180specifying, 174-175

slide showsrunning, 187-188settings, 187transitions, 186

slidescreating, 171inserting from

files, 172methods, 174properties, 172-173specifying, 170-171

PPmt function, 63, 365precedence (operators),

57-58controlling, 58-60table of, 58

prefixes, data type, 38Presentation object

methods, 167-168properties, 166-167SlideShowSettings

property, 187specifying, 165-166

Presentations collection, 166

Presentations object, 165presentations. See

PowerPoint presentationsPrint method, 348-349Print statement, 358printing data in Immediate

window, 348-349PrintOut method, 167-168Private statement, 358Procedure command

(Insert menu), 20procedures. See also macros

AddingARecord, 205-206AddJugglingSlides,

173-174Application_

ItemSend, 219Application_Quit, 218

Index Outlook394

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 394

Page 25: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

Application_Reminder,227-228

Application_Startup, 218assigning keyboard

shortcuts to, 142-143BackUpToDrive, 328-329BigNumbers, 105-106BoldAndItalic, 145btnChooseAnotherStyle_

OnAction, 287btnCloseWindow_

GetEnabled, 297btnCloseWindow_

OnAction, 296btnPromptToSaveChanges

_OnAction, 279btnRefreshList_

OnAction, 295-297ButtonTest, 48ButtonTest2, 49cbWindows_

GetItemCount, 292-293cbWindows_

GetItemID, 292cbWindows_

GetItemLabel, 293cbWindows_

OnChange, 296-297chkToggleProofingErrors

_OnAction, 282CloseAllOpenDocuments,

121-122ColorTester, 101ConcatenateStrings, 157CreateJuggling

Presentation, 169-170debugging

break mode, 339-342breakpoints, 341compile errors, 338data tips feature, 347debugging tips and

techniques, 350-352Immediate window,

348-350Locals window, 344

logic errors, 339overview, 337-338Quick Watch

feature, 347runtime errors,

338-339stepping into

procedures, 343stepping out of

procedures, 343stepping over

procedures, 343stepping to cursor, 343syntax errors, 338watch expressions,

344-346definition of, 19DeleteAll, 143DeleteFolder, 317-318DeletingARecord, 207DisplaySentenceLengths,

134-135DivideNumbers, 331-332dlLaunchInsertHyperlink

Dialog_OnAction, 289DoNotSaveChanges_

OnAction, 279EditingARecord, 204EvaluateTest, 141FormatFirstParagraph,

131-132FormatParagraph, 80-81FormatParagraph2, 81ForwardAndDeleteAttach

ments, 229-230galInsertHyperlinksFor_

OnAction, 287GetAllChapter14Settings,

309GetAttributes, 314GetFilenames, 311-312GetFolderUsage, 312-313GetNumbers, 326GoToNextSentence, 130inboxItems_ItemAdd,

219, 223-224

increasing speed ofavoiding data

selection, 319avoiding

recalculation, 319-320hiding documents, 319optimizing loops,

320-321turning off screen

updating, 319InputBoxTest, 51InsertAndRedefine

Name, 164InsertHyperlinks, 136-137InsertParagraphsAndText,

127-128ListFolders, 215-216LoopTest, 107lstInsertHyperlinksFor_

GetSelectedItemIndex, 291

lstInsertHyperlinksFor_OnAction, 285

Main (Jugglingpresentation), 169

MakeBackup, 122-124mnuCloseDocument2_

OnAction, 280NewWorkbookWith

CustomSheets, 148PerformCalculations, 42ReadInboxData, 233-234RecordsetBookmark

Navigation, 201RecordsetData, 199RecordsetOpen

Properties, 196RecordsetOpen

SELECT, 197RecordsetOpenTable,

193-194RemoveChapter14

Setting, 309ResetKey, 143RetrieveProducts, 210-212

How can we make this index more useful? Email us at [email protected]

395procedures

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 395

Page 26: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

RetrievingEntireRecords, 209

RunJugglingSlideShow,187-188

running at specific times, 144

SaveAll, 149SaveChanges_

OnAction, 279SearchRecordsWithFind,

202-203SelectA1OnAllSheets,

158-159SelectCurrentNamed

Range, 161SelectHomeCells,

159-160SendAMessage, 227SetKey, 143SetUpJugglingSlides,

183-185SetUpStartPage, 180-181SpellCheckTest, 87stepping into, 343stepping out of, 343stepping over, 343StoreWorksheetNames,

42-43TabStrip1_Change,

256-257tbToggleDeveloperTab_

GetPressed, 290tbToggleDeveloperTab_

OnAction, 283TimingTest, 320-321ToggleDeveloeprTab, 283UndoBoldAndItalic, 146user-defined functions

calling, 26definition of, 19, 24entering into cells,

26-27expressions, 24structure, 24writing, 25

UserForm_Initialize, 256

UserForm_Terminate, 260VBAWait, 108Workbook_Open,

308-309processing forms, 259-262program variables.

See variablesprojects

adding forms to, 238definition of, 17digital signatures, 304-305

prompting users forOutlook folders, 216-217

properties (of objects). Seealso specific properties

multiple properties, 80-81listing, 27-28overview, 74, 129, 239referencing, 73returning value of, 75setting value of, 75

Property Get statement, 358

Property Let statement, 358

Property Set statement, 358

Public statement, 358Put statement, 358pv function, 62-63, 365

Q

QBColor function, 367Quick Access toolbar,

11-13Quick Watch command

(Debug menu), 347Quick Watch dialog

box, 347

R

Raise method, 333RaiseEvent statement, 358random numbers,

generating, 61-62Randomize statement, 358Range method, 125,

153-154, 171, 175Range object, 125

in Exceldefining range

names, 162inserting data into

ranges, 162-163resizing ranges,

163-164returning data about

ranges, 163returning with Cells

method, 154returning with

Columns method, 156returning with Offset

method, 157-158returning with Range

method, 153-154returning with Rows

method, 155-156selecting ranges,

158-161in Word, 153

Bold property, 126Case property, 126Delete method,

128-129deleting text, 128-129Font property, 126formatting text, 126InsertAfter

method, 127InsertBefore

method, 127inserting text, 127-128

Index procedures396

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 396

Page 27: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

InsertParagraphmethod, 127

InsertParagraphAftermethod, 127

InsertParagraphBeforemethod, 127

InsertParagraphsAndText procedure, 127-128

Italic property, 126reading and changing

range text, 126returning with Range

method, 125returning with Range

property, 125Range property, 125ranges. See Range objectrate function, 62-63, 365ReadInboxData procedure,

233-234reading

application settings fromRegistry, 306-307

range text (Word), 126section settings, 309

ReadReceiptRequestedproperty (MailItemobject), 221

recalculating worksheets,140, 319

ReceivedTime property(MailItem object), 221

RecentFiles object, 73,116-117

Recipients object, 226Recipients property

(MailItem object), 221Record Macro command

(Macros menu), 5-7Record Macro dialog

box, 5-7

recording macrosExcel macros, 7-8overview, 3Word macros, 5-7

recordsadding, 205-206deleting, 207-208editing, 203-205finding, 202-203navigating, 199-201

Recordset objectaccessing recordset

data, 198-199adding records, 205-206deleting records, 207-208editing records, 203-205finding records, 202-203methods, 199

AddNew, 205-206Delete, 207Find, 202GetRows, 208Move, 200MoveFirst, 200MoveLast, 200MoveNext, 200MovePrevious, 200Open, 193-195Update, 204

navigating records, 199-201

opening with Openmethod, 194-196

opening with SELECTstatement, 196-198

opening with tables, 193-194

overview, 192-193properties, 195

BOF property, 200EOF property, 200Fields property, 198

RecordsetBookmarkNavigation procedure, 201

RecordsetData procedure, 199

RecordsetOpenPropertiesprocedure, 196

RecordsetOpenSELECTprocedure, 197

RecordsetOpenTable procedure, 193-194

recordsets. See alsoRecordSet object

accessing recordset data, 198-199

adding records, 205-206deleting records, 207-208editing records, 203-205exporting from Access to

Excel, 210-212finding records, 202-203navigating records,

199-201opening with tables,

193-198overview, 192-193

ReDim statement, 42, 358referencing

Outlook folders, 214Outlook from other

applications, 231Registry

deleting settings from, 307overview, 305reading section

settings, 309reading settings from,

306-307storing settings in, 306tracking file usage,

307-309Relationship element

(XML), 265, 269Rem statement, 358Remove command (File

menu), 301

How can we make this index more useful? Email us at [email protected]

397Remove command (File menu)

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 397

Page 28: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

RemoveChapter14Settingprocedure, 309

RemoveItem method, 253removing

attachments from forwarded messages,229-230

modules, 301renaming

files/folders, 316modules, 299-300

Replace function, 64, 369Reply method, 225ReplyAll method, 225replying to email, 225Reset statement, 359ResetKey procedure, 143resetting controls, 293-295Resize method, 163resizing

controls, 244Excel ranges, 163-164

Resume statement, 327-329, 359

resuming program execution, 327-329

RetrieveProducts procedure, 210-212

RetrievingEntireRecordsprocedure, 209

RGB function, 80, 99, 367Ribbon customization

advantages, 270controls

attributes, 276-277buttons, 277check boxes, 281-282combo boxes, 288dialog box launchers,

289drop-down lists,

284-285

galleries, 285-287getting and changing

control values, 295-297

initializing, 290-293menus, 278-280resetting, 293-295split buttons, 280-281toggle buttons,

282-283Custom UI Editor, 270extensibility, 263-265groups

creating, 274customizing existing

groups, 274-275hiding built-in Ribbon,

270-271macro-enabled

documents/templates,creating, 265-267

MyRibbon.xml fileadding to document

package, 268-269creating, 267-268renaming and

opening, 269overview, 263RibbonX, 270tabs

creating, 271-272customizing existing

tabs, 272-273ribbon element (XML),

271RibbonX, 270

controlsattributes, 276-277buttons, 277check boxes, 281-282combo boxes, 288dialog box

launchers, 289drop-down lists,

284-285galleries, 285-287

getting and changingcontrol values, 295-297

initializing, 290-293menus, 278-280resetting, 293-295split buttons, 280-281toggle buttons,

282-283elements

checkBox, 281comboBox, 288dialogBoxLauncher,

289dropdown, 284gallery, 285-287group, 274-275menu, 278Relationship, 265, 269ribbon, 271splitButton, 280tab, 272-273tabs, 271toggleButton, 282-283

groupscreating, 274customizing, 274-275

hiding built-in Ribbon,270-271

tabscreating, 271-272customizing, 272-273

Right function, 65, 369Right$ function, 65, 369RightB function, 369RightB$ function, 369RightToLeft property

(forms), 240RmDir statement,

316-318, 359Rnd function, 61, 365Root Certificate

Program, 304Round function, 365

Index RemoveChapter14Setting procedure398

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 398

Page 29: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

Row property (Rangeobject), 163

rowsexporting from Access to

Excel, 208-210returning, 155-156

Rows method, 155-156RowSource property

(ListBox object), 252RSet statement, 359RTrim function, 65, 369RTrim$ function, 65, 369rules (Outlook), 223-224Run method, 187-188Run To Cursor command

(Debug menu), 343RunJugglingSlideShow

procedure, 187-188running

macros, 8, 21-22PowerPoint slide shows,

187-188procedures

at specific times, 144when user selects

Repeat or Undo, 144-146

runtime errors, 338-339

S

Save methodDocument object, 119Presentation object, 168

SaveAll procedure, 149SaveAs method

Attachment object, 229Document object, 120Presentation object, 168

SaveChanges_OnActionprocedure, 279

Saved property(Presentation object), 167

SaveSetting statement,306, 359

savingExcel workbooks, 148-149Word documents, 118

with Save method, 119with SaveAs

method, 120screen updating, turning

off, 319screentip attribute

(controls), 277ScreenUpdating property

(Application object), 319ScrollBar object, 253ScrollBars property

(forms), 241ScrollHeight property

(forms), 242Scrolling properties

(forms), 241-242ScrollLeft property

(forms), 242ScrollTop property

(forms), 242ScrollWidth property

(forms), 242SearchRecordsWithFind

procedure, 202-203Second function, 69, 363section settings,

reading, 309security

digital signatures, 304-305macros

macro security levels,302-304

overview, 301trusted locations,

301-302

Seek function, 364Seek statement, 359Select All command (Edit

menu), 243Select Case statement,

97-101, 359FutureValue4()

example, 98LetterGrade() example,

98-99syntax, 97VBAColor() example,

99-101Select Certificate dialog

box, 305Select Database dialog

box, 192Select method, 129, 182SELECT statement,

196-198SelectA1OnAllSheets

procedure, 158-159SelectCurrentNamed

Range procedure, 161SelectHomeCells

procedure, 159-160selecting

controls, 243Excel cells/ranges

selecting A1 on allworksheets, 158-159

selecting home cell onall worksheets, 159-160

selecting named rangethat contains activecell, 160-161

selection handles, 243Selection object

Collapse method, 132collapsing selection, 132creating, 129

How can we make this index more useful? Email us at [email protected]

399Selection object

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 399

Page 30: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

extending selection, 131-132

MoveEnd method, 130MoveStart method, 130moving insertion

point, 130overview, 129Type property, 129

SendAMessage procedure, 227

SenderEmailAddress property (MailItemobject), 221

SenderName property(MailItem object), 221

sending email messages,226-227

SendKeys statement, 359Sensitivity property

(MailItem object), 221Sentences object, 133-135SentOn property

(MailItem object), 221serial numbers, 68sessions (Outlook)

logging off, 233-234logging on, 232

Set statement, 79, 359SetAttr statement, 318, 359SetKey procedure, 143SetUpJugglingSlides

procedure, 183-185SetUpStartPage procedure,

180-181Sgn function, 61, 365Shadow property (Shape

object), 179Shape objects

(PowerPoint)adding to slides, 175-178methods, 176-178,

181-182

properties, 178-180specifying, 174-175

Shapes property (Slideobject), 173

Shell function, 364shortcut keys

assigning to Excel macros, 10-11

assigning to Word macros, 9-10

Show method, 85ShowModal property

(forms), 240ShowType property

(SlideShowSettingsobject), 187

ShowWithAnimation property(SlideShowSettingsobject), 187

ShowWithNarration property(SlideShowSettingsobject), 187

shutting down Visual BasicEditor, 30

signatures, digital, 304-305Sin function, 61, 365Single data type, 37size attribute

(controls), 276Size property (MailItem

object), 221sizing controls, 244slash (/), 55Slide objects

adding to presentations, 171

methods, 174properties, 172-173Range method, 171specifying, 170-171

slide shows (PowerPoint)running, 187-188settings, 187transitions, 186

SlideMaster property(Presentation object), 167

slides (PowerPoint)creating, 171inserting from files, 172methods, 174properties, 172-173specifying, 170-171

Slides collectionAdd method, 171InsertFromFile

method, 172Slides property

(Presentation object), 167SlideShowSettings

object, 187SlideShowSettings

property (Presentationobject), 167, 187

SlideShowTransition property (Slide object), 173

SlideShowTransitionsobject, 186

SLN function, 63, 365SmallChange property

(ScrollBar object), 253Sort method, 75Source property

Err object, 330Recordset object, 195

Space function, 65, 369Space$ function, 65, 369spam, filtering, 224-225SpecialEffect property

(forms), 239spell checking, 87

Index Selection object400

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 400

Page 31: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

SpellCheckTest procedure, 87

spin buttons, 253-254SpinButton object,

253-254split buttons (Ribbon),

creating, 280-281Split function, 370splitButton element

(XML), 280Sqr function, 61, 366StandardHeight property

(Worksheet object), 151StandardWidth property

(Worksheet object), 152StartingSlide property

(SlideShowSettingsobject), 187

StartUpPosition property(forms), 241

statements. See alsofunctions; methods;loops; procedures

AppActivate, 356Beep, 356Call, 356ChDir, 315, 356ChDrive, 315, 356Close, 356comments, 22Const, 45, 356Date, 356Declare, 356DefBool, 356DefByte, 356DefCur, 356DefDate, 356DefDbl, 356definition of, 355DefInt, 356DefLng, 356DefObj, 356DefSng, 356

DefStr, 356DefType, 39DefVar, 356DeleteSetting, 307, 357Dim, 33-34, 357Do...Loop, 105-106, 357End, 357entering, 22-23Enum, 357Erase, 357Error, 357Event, 357executing in Immediate

window, 350Exit, 357Exit Do, 110Exit For, 110FileCopy, 315, 357For Each...Next, 109, 357For...Next, 106-108, 357Function, 38, 357Get, 357GetAllSettings, 309GetSetting, 306-307GoSub...Return, 357GoTo, 357If...Then

And operator, 95block syntax, 92example, 92-93Or operator, 95single-line syntax, 92

If...Then...Else, 357example, 93-94indenting for

readability, 94multiple

If...Then...Else statements, 95-96

syntax, 93Implements, 357indenting for

readability, 111Input, 357Kill, 315-316, 357

Let, 357Line Input, 357Load, 258, 357Lock, 357LSet, 358MkDir, 316, 358Name, 316, 358On Error, 358On Error GoTo, 325On Error Resume

Next, 324On...GoSub, On...

GoTo, 358Open, 358Option Base 0|1, 358Option Compare

Text|Binary, 358Option Explicit, 351, 358Option Private, 358Print, 358Private, 358Property Get, 358Property Let, 358Property Set, 358Public, 358Put, 358RaiseEvent, 358Randomize, 358ReDim, 42, 358Rem, 358Reset, 359Resume, 327-329, 359RmDir, 316-318, 359RSet, 359SaveSetting, 306, 359Seek, 359SELECT, 196-198Select Case, 359

FutureValue4() example, 98

LetterGrade() example, 98-99

syntax, 97VBAColor()

example, 99-101SendKeys, 359

How can we make this index more useful? Email us at [email protected]

401statements

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 401

Page 32: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

Set, 79, 359SetAttr, 318, 359Static, 359Stop, 342, 359Sub, 359Time, 359Type, 359Unload, 259, 359Unlock, 359While...Wend, 359Width, 359With...End With, 359Write, 359

Static statement, 359status bars, displaying

messages in, 82StatusBar property

(Application object), 82Step Into command

(Debug menu), 340, 343Step Out command

(Debug menu), 343Step Over command

(Debug menu), 343stepping into

procedures, 343stepping out of

procedures, 343stepping over

procedures, 343stepping to cursor, 343Stop Recording command

(Macros menu), 7-8Stop statement, 342, 359StoreWorksheetNames

procedure, 42-43storing

application settings inRegistry, 305-306

user input in variables, 45InputBox function,

50-51MsgBox function,

45-49

Str function, 65, 370Str$ function, 65, 370StrComp function, 65, 370StrConv function, 65String data type, 36String function, 65, 370String$ function, 65, 370strings

concatenating, 157converting into objects,

140-141String data type, 36string expressions, 63-66string functions, 65,

368-370StrReverse function, 370Style property (ComboBox

object), 252Sub statement, 359Subject property (MailItem

object), 221subscripts, 41subtraction operator (-), 55supertip attribute (con-

trols), 277supplementing reminders

with email messages, 227-228

Switch function, 103-104,367

SYD function, 63, 365syntax checking, 351syntax errors, 23, 338

T

tab element (XML), 272-273

Tab function, 367tab order (controls),

setting, 247-248

Tab Order command (Viewmenu), 247

Tab Order dialog box, 247tab strips, 254-257

initializing, 256modifying controls in,

256-257TabIndex property

(controls), 247tables, opening recordsets

with, 193-194tabs (Ribbon)

creating, 271-272customizing, 272-273

tabs element (XML), 271TabStop property

(controls), 247TabStrip object, 254-257

initializing, 256modifying controls in,

256-257TabStrip1_Change

procedure, 256-257Tan function, 61, 366tbToggleDeveloperTab_

GetPressed procedure, 290

tbToggleDeveloperTab_OnAction procedure, 283

templates, macro-enabled,265-267

text (Word)Paragraph object, 136-138Range object

Bold property, 126Case property, 126Delete method,

128-129deleting text, 128-129Font property, 126formatting text, 126InsertAfter

method, 127

Index statements402

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 402

Page 33: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

InsertBefore method, 127

inserting text, 127-128InsertParagraph

method, 127InsertParagraphAfter

method, 127InsertParagraphBefore

method, 127InsertParagraphsAnd

Text procedure, 127-128

Italic property, 126reading and changing

range text, 126returning with Range

method, 125returning with Range

property, 125Selection object

Collapse method, 132collapsing

selection, 132creating, 129extending selection,

131-132MoveEnd method, 130MoveStart method, 130moving insertion

point, 130overview, 129Type property, 129

Sentences object, 133-135Words object, 132-133

text boxes, 249-250Text property

ListBox object, 252TextBox object, 250

TextBox object, 249-250TextEffectFormat property

(Shape object), 179TextFrame property

(Shape object), 180ThisDocument object, 116

ThisWorkbook object, 146Time function, 69, 363Time statement, 359Time$ function, 69, 363time/date functions,

362-363Timer function, 69, 363TimeSerial function,

69, 363TimeValue function,

69, 144, 363TimingTest procedure,

320-321title bar captions, 82To property (MailItem

object), 221Toggle Breakpoint

command (Debug menu), 341

toggle button, 251, 282-283

toggleButton element(XML), 282-283

ToggleButton object, 251ToggleDeveloperTab

procedure, 283toolbar, Quick Access,

11-13Tools menu commands,

Digital Signature, 305Top property

Application object, 83forms, 241Shape object, 180

tracking file usage, 307-309

transitions (PowerPoint), 186

trapping errorsdisabling traps, 330Err object

methods, 332-333overflow errors, 330overview, 330properties, 330-332type mismatch

errors, 330error handlers, 325-327On Error GoTo

statement, 325On Error Resume Next

statement, 324overview, 323-324Resume statement,

327-329trappable VBA errors,

table of, 333-335Trim function, 65, 100, 370Trim$ function, 65, 370true/false decisions

making with If...Thenstatement

And operator, 95block syntax, 92example, 92-93Or operator, 95single-line syntax, 92

making withIf...Then...Else statement

example, 93-94indenting for

readability, 94multiple

If...Then...Else statements, 95-96

syntax, 93Trust Center dialog box,

302-303trusted locations, 301-302type function, 62Type keyword, 40

How can we make this index more useful? Email us at [email protected]

403Type keyword

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 403

Page 34: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

type mismatch errors, 330Type property

Recipient object, 226Selection object, 129

Type statement, 359TypeName function, 367

U

UBound function, 43, 367UCase function, 65,

140, 370UCase$ function, 65, 370underscore (_), 66UndoBoldAndItalic

procedure, 146Ungroup command

(Format menu), 245Unload statement,

259, 359unloading forms, 258-259Unlock statement, 359UnRead property

(MailItem object), 221Update method, 204upper bounds of arrays,

returning, 41, 43UsableHeight property

(Application object), 83UsableWidth property

(Application object), 83UsedRange property

(Worksheet object), 152user-defined constants,

45, 352user-defined data

types, 39-40user-defined functions

calling, 26definition of, 19, 24entering into cells, 26-27

expressions, 24structure, 24writing, 25

user input, storing in variables

InputBox function, 50-51MsgBox function, 45-49

UserForm_Initialize procedure, 256

UserForm_Terminate procedure, 260

V

Val function, 65, 370Value property

controls, 259-260ScrollBar object, 253

variablesarrays

declaring, 41definition of, 40dynamic arrays, 41-43finding lower/upper

bounds of, 41-43multidimensional

arrays, 44one-dimensional

arrays, 44assigning objects to, 79-80avoiding errors, 35-36data types

Boolean, 37Byte, 36changing, 39Currency, 37data type prefixes, 38Date, 36DefType keywords, 39Double, 37Integer, 36Long, 37Object, 36Single, 37specifying, 36-38

String, 36user-defined data

types, 39-40Variant, 37

declaring, 33-35explicit declarations,

35-36implicit

declarations, 35naming, 34requiring variable

declarations, 351storing user input in

InputBox function, 50-51

MsgBox function, 45-49

Variant data type, 37VarType function, 367VBA macros. See macrosvbAbort return value

(MsgBox function), 49vbAbortRetryIgnore option

(MsgBox buttons), 47VBAColor function, 100vbApplicationModal option

(MsgBox buttons), 47VBAWait procedure, 108vbCancel return value

(MsgBox function), 49vbCritical option (MsgBox

buttons), 47vbDefaultButton1 option

(MsgBox buttons), 47vbDefaultButton2 option

(MsgBox buttons), 47vbDefaultButton3 option

(MsgBox buttons), 47vbExclamation option

(MsgBox buttons), 47vbIgnore return value

(MsgBox function), 49

Index type mismatch errors404

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 404

Page 35: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

vbInformation option(MsgBox buttons), 47

vbNo return value(MsgBox function), 49

vbOK return value(MsgBox function), 49

vbOKCancel option(MsgBox buttons), 47

vbOKOnly option (MsgBoxbuttons), 47

vbQuestion option(MsgBox buttons), 47

vbRetry return value(MsgBox function), 49

vbRetryCancel option(MsgBox buttons), 47

vbSystemModal option(MsgBox buttons), 47

vbYes return value(MsgBox function), 49

vbYesNo option (MsgBoxbuttons), 47

vbYesNoCancel option(MsgBox buttons), 47

View menu commandsCode, 248Immediate Window, 348Tab Order, 247Watch Window, 344

visible attribute (controls), 277

Visible propertycontrols, 247Shape object, 180Worksheet object, 152

Visual Basic Editordisplaying, 16modules

creating, 17-18opening, 18-19

shutting down, 30

W

Wait method, 104, 141watch expressions

adding, 344-345deleting, 346editing, 346

Watch Window command(View menu), 344

Weekday function, 69, 363WeekdayName function,

69, 363While...Wend

statement, 359Width property

Application object, 83forms, 241Shape object, 180

Width statement, 359Window object, 88windows, opening, 88WindowState property

(Application object), 83With...End With

statement, 359wizards, Function, 26-27word completion feature

(IntelliSense), 30word count, testing, 102Word documents

ActiveDocument object, 116

backing up, 122-124closing

Close method, 121closing all documents,

121-122creating, 118Document object, 115

macro-enabled docu-ments/templates, creat-ing, 265-267

openingwith Open

method, 116with RecentFiles

object, 116-117Paragraph object, 136-138Range object

Bold property, 126Case property, 126Delete method,

128-129deleting text, 128-129Font property, 126formatting text, 126InsertAfter

method, 127InsertBefore

method, 127inserting text, 127-128InsertParagraph

method, 127InsertParagraphAfter

method, 127InsertParagraphBefore

method, 127InsertParagraphsAnd

Text procedure, 127-128

Italic property, 126reading and changing

range text, 126returning with Range

method, 125returning with Range

property, 125saving, 118

with Save method, 119with SaveAs

method, 120Selection object

Collapse method, 132collapsing

selection, 132

How can we make this index more useful? Email us at [email protected]

405Word documents

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 405

Page 36: 00 McFedries FM - pearsoncmg.comptgmedia.pearsoncmg.com/images/9780789736673/index/07897366… · OnTime, 144 OnUndo, 145-146 Wait, 141 properties Caption, 82 Dialogs, 83-87 Height,

creating, 129extending selection,

131-132MoveEnd method, 130MoveStart method, 130moving insertion

point, 130overview, 129Type property, 129

Sentences object, 133-135ThisDocument

object, 116Words object, 132-133

Word macrosrecording, 5-7shortcut keys, 9-10

wordscounting, 133displaying sentence word

counts, 134-135Words object, 132-133WordWrap property

(TextBox object), 250Workbook object

closing workbooks, 150creating workbooks, 147opening workbooks,

146-147saving workbooks,

148-149specifying number of

worksheets, 147-148workbooks (Excel)

closing, 150creating, 147opening, 146-147recalculating, 140saving, 148-149specifying number of

worksheets, 147-148Workbooks collection

Add method, 147Open method, 146-147

Workbooks object, 146Workbook_Open

procedure, 308-309Worksheet object

creating worksheets, 151methods, 152-153properties, 151-152specifying, 150-151

WorksheetFunction property (Applicationobject), 139-140

worksheets (Excel)creating, 151functions, accessing,

139-140importing Access data

into, 208individual field

values, 208recordsets, 210-212rows, 208-210

methods, 152-153properties, 151-152specifying, 150-151

Worksheets collection, 151Write statement, 359writing macros

advantages of, 15Developer tab,

displaying, 16example, 20-21modules

creating, 17-18opening, 18-19

names, 20VBA statements,

entering, 22-23Visual Basic Editor,

displaying, 16writing user-defined

functions, 25

X-Y-Z

XML documents. See alsoRibbonX

elementscheckBox, 281comboBox, 288dialogBoxLauncher,

289dropdown, 284gallery, 285-287group, 274-275menu, 278Relationship, 265, 269ribbon, 271splitButton, 280tab, 272-273tabs, 271toggleButton, 282-283

MyRibbon.xml fileadding to document

package, 268-269creating, 267-268renaming and

opening, 269Xor operator, 57

Year function, 69, 363

Index Word documents406

24_McFedries_Index.qxd 3/7/07 8:30 AM Page 406