Option Private Module Statement

Restricts the scope and visibility of the contents of a module i.e., its variables, classes, functions, and procedures in VBA-enabled applications that allow references across multiple projects e.g., Microsoft Office applications to the module's project. Option Private Module has no effect in the standalone version of Visual Basic. The Option Private Module statement must appear in the declarations section of a module before any procedures. 446 Chapter 7- The Language Reference Publicly...

Chr Chr ChrB ChrB ChrW Functions

Chr charactercode Chr charactercode ChrB charactercode ChrB charactercode ChrW charactercode charactercode An expression that evaluates to either an ASCII or DBCS character code. Chr, ChrB, and ChrW return a variant of the string subtype that contains the character represented by charactercode. Chr and ChrB return a string containing the character represented by char- Returns the character represented by charactercode. Chr and Chr return the character associated with an ASCII or ANSI character...

Printer Object and Printers Collection

Since it's part of the VB library, the Printer object isn't available to VBA applications. When you write a VBA as opposed to VB program, you simply make use of the host application's own built-in printing functionality. For example Set oWordActiveDoc oWord.Documents.Add Set oWordSel oWord.Selection oWordSel.TypeText This is text coming in from the VB app. oWordSel.Font.Name Arial Visual Basic contains a global printer object, which refers to the default printer for the current system. Because...

Asc AscB AscW Functions

Asc string AscB string AscW string string Any expression that evaluates to a string. Return Value An integer that represents the character code of the first character of the string. The range for the returned value is 0-255 on non-DBCS systems, but -32768-32767 on DBCS systems. Returns the ANSI or Unicode character code that represents the first character of the string passed to it. All other characters in the string are ignored. Use AscB with Byte data and AscW on Unicode DBCS systems. The...

Delete Setting Statement Named Arguments

DeleteSetting appname , section , key appname The name of the application. This must be a subkey of the HKEY_ CURRENT_USER Software VB and VBA Program Settings registry key. The name of the application key's subkey that is to be deleted. section can be a single key or a registry path separated with backslashes. The name of the value entry to delete. Description Deletes a complete application key, one of its subkeys, or a single value entry from the Windows registry. section can contain a...