Etudes for Microsoft Word Programmers. Appendix.


Information on this page is from Microsoft MSDN http://msdn.microsoft.com.

Object Application (Word 2003)

Application object contains properties and methods of Microsoft Word.

Application Object Properties

The following table lists Application object properties.

Property

Type

Description

ActiveDocument

Read-only

Returns a Document object that represents the active document (the document with the focus). If there are no documents open, an error occurs.

ActivePrinter

Read/write String

Returns or sets the name of the active printer.

ActiveWindow

Read-only

Returns a Window object that represents the active window (the window with the focus). If there are no windows open, an error occurs.

AddIns

Read-only

Returns an AddIns collection that represents all available add-ins, regardless of whether they're currently loaded. The AddIns collection includes the global templates and Word add-in libraries (WLLs) listed in the Templates and Add-ins dialog box (Tools menu).

AnswerWizard

AnswerWizard object

Returns an AnswerWizard object that contains the files used by the online Help search engine.

Application

Application object

Used without an object qualifier, this property returns an Application object that represents the Microsoft Word application. Used with an object qualifier, this property returns an Application object that represents the creator of the specified object. When used with an OLE Automation object, it returns the object's application.
Remarks
Visual Basic's CreateObject and GetObject functions give you access to an OLE Automation object from a Visual Basic for Applications project.

ArbitraryXMLSupport­Available

Boolean

Returns a Boolean that represents whether Microsoft Word accepts custom XML schemas. True indicates that Word accepts custom XML schemas.
Remarks
Microsoft Office Standard Edition 2003 includes XML support using the Word XML schema, but it does not provide support for custom XML schemas. Support for custom XML schemas is available only in the stand-alone release of Office Word 2003 and in Office Professional Edition 2003. Use the ArbitraryXMLSupportAvailable property to determine which release is installed.

Assistant

Assistant object

Returns an Assistant object that represents the Microsoft Office Assistant.

AutoCaptions

Read-only AutoCaptions collection

Returns an AutoCaptions collection that represents the captions that are automatically added when items such as tables and pictures are inserted into a document.

AutoCorrect

Read-only AutoCorrect object

Returns an AutoCorrect object that contains the current AutoCorrect options, entries, and exceptions.

AutoCorrectEmail

AutoCorrect object

Returns an AutoCorrect object that represents automatic corrections made to e-mail messages.

AutomationSecurity

MsoAutomation­Security constant

Returns or sets an MsoAutomationSecurity constant that represents the security setting Microsoft Word uses when programmatically opening files.
Remarks
The default setting of the AutomationSecurity property is msoAutomationSecurityLow. Therefore, to avoid changing the users security settings or breaking solutions that rely on the default setting, you should be careful to set this property back to its original setting after programmatically opening a file.
Setting ScreenUpdating to False does not affect alerts and will not affect security warnings. The DisplayAlerts setting will not apply to security warnings. For example, if the user sets DisplayAlerts equal to False and AutomationSecurity to msoAutomationSecurityByUI, while the user is on Medium security level, then there will be security warnings while the macro is running. This allows the macro to trap file open errors, while still showing the security warning if the file open succeeds.

BackgroundPrinting­Status

Read-only Long

Returns the number of print jobs in the background printing queue.

BackgroundSaving­Status

Read-only Long

Returns the number of files queued up to be saved in the background.

BrowseExtra­FileTypes

Read/write String

Set this property to "text/html" to allow hyperlinked HTML files to be opened in Microsoft Word (instead of the default Internet browser).

Browser

Read-only

Returns a Browser object that represents the Select Browse Object tool on the vertical scroll bar.

Build

Read-only String

Returns the version and build number of the Word application.

CapsLock

Read-only Boolean

True if the CAPS LOCK key is turned on.

Caption

Read/write String

Returns or sets the caption text for the specified document or application window.
Remarks
To change the caption of the application window to the default text, set this property to an empty string ("").

CaptionLabels

Read-only CaptionLabels collection

Returns a CaptionLabels collection that represents all the available caption labels.

CheckLanguage

Read/write Boolean

True if Microsoft Word automatically detects the language you are using as you type.
Remarks
If you haven't set up Word for multilingual editing, the CheckLanguage property always returns False. For more information about automatic language detection, see About automatic language detection .

COMAddIns

COMAddIns collection

Returns a reference to the COMAddIns collection that represents all the Component Object Model (COM) add-ins currently loaded in Microsoft Word. These are listed in the COM Add-Ins dialog box. You can add the COM Add-Ins command to your Tools menu by using the Customize dialog box (Tools menu).

CommandBars

CommandBars collection

Returns a CommandBars collection that represents the menu bar and all the toolbars in Microsoft Word.
Remarks
Use the CustomizationContext property to set the template or document context prior to accessing the CommandBars collection.

Creator

Read-only Long

Returns a 32-bit integer that indicates the application in which the specified object was created. For example, if the object was created in Microsoft Word, this property returns the hexadecimal number 4D535744, which represents the string "MSWD." This value can also be represented by the constant wdCreatorCode.
Remarks
The Creator property was primarily designed to be used on the Macintosh, where each application has a four-character creator code. For example, Microsoft Word has the creator code MSWD. For additional information about this property, consult the language reference Help included with Microsoft Office Macintosh Edition.

CustomDictionaries

Read-only Dictionaries object

Returns a Dictionaries object that represents the collection of active custom dictionaries. Active custom dictionaries are marked with a check in the Custom Dictionaries dialog box.

CustomizationContext

Read/write Template or Document object

Returns or sets a Template or Document object that represents the template or document in which changes to menu bars, toolbars, and key bindings are stored. Corresponds to the value of the Save in box on the Commands tab in the Customize dialog box (Tools menu).

DefaultLegal­Blackline

Read/write Boolean

True for Microsoft Word to compare and merge documents using the Legal blackline option in the Compare and Merge Documents dialog box.
Remarks
For more information about the Legal blackline option, see About comparing and merging documents and Compare documents with the Legal blackline option .

DefaultSaveFormat

Read/write String

Returns or sets the default format that will appear in the Save as type box in the Save As dialog box (File menu). Corresponds to the Save Word files as box on the Save tab in the Options dialog box (Tools menu).
Remarks
The string used with this property is the file converter class name. The class names for internal Word formats are listed in "File converter class name".
Use the ClassName property with a FileConverter object to determine the class name of an external file converter.

DefaultTable­Separator

Read/write String

Returns or sets the single character used to separate text into cells when text is converted to a table.
Note  The value of the DefaultTableSeparator property is used if the Separator argument is omitted from the ConvertToTable method.

Dialogs

Read-only Dialogs collection

Returns a Dialogs collection that represents all the built-in dialog boxes in Word. See enumerationWdWordDialog.

DisplayAlerts

Read/write WdAlertLevel

Returns or sets the way certain alerts and messages are handled while a macro is running.
Note  If you set this property to wdAlertsNone or wdAlertsMessageBox, Word doesn't set it back to wdAlertsAll when your macro stops running. You should write your macro in such a way that it always sets the DisplayAlerts property back to wdAlertsAll when it stops running.

DisplayAuto­CompleteTips

Read/write Boolean

True if Word displays tips that suggest text for completing words, dates, or phrases as you type.

DisplayRecentFiles

Read/write Boolean

True if the names of recently used files are displayed on the File menu.

DisplayScreenTips

Read/write Boolean

True if comments, footnotes, endnotes, and hyperlinks are displayed as tips. Text marked as having comments is highlighted.

DisplayScrollBars

Read/write Boolean

True if Word displays a scroll bar in at least one document window. False if there are no scroll bars displayed in any window.
Remarks
Setting the DisplayScrollBars property to True displays horizontal and vertical scroll bars in all windows. Setting this property to False turns off all scroll bars in all windows.
Use the DisplayHorizontalScrollBar and DisplayVerticalScrollBar properties to display individual scroll bars in the specified window.

DisplayStatusBar

Read/write Boolean

True if the status bar is displayed.

Documents

Read-only Documents collection

Returns a Documents collection that represents all the open documents.

EmailOptions

Read-only EmailOptions object

Returns an EmailOptions object that represents the global preferences for e-mail authoring.

EmailTemplate

Read/write String

Returns or sets a String that represents the document template to use when sending e-mail messages.
Remarks
Use the EmailTemplate property when Microsoft Word is specified as your e-mail editor, which you must do inside Microsoft Outlook.

EnableCancelKey

Read/write WdEnableCancelKey

Returns or sets the way that Word handles CTRL+BREAK user interruptions.
Remarks
Use this property very carefully. If you use wdCancelDisabled, there's no way to interrupt a runaway loop or other non – self-terminating code. Also, the EnableCancelKey property is not reset to wdCancelInterrupt when your code stops running; unless you explicitly reset its value, it will remain set to wdCancelDisabled for the duration of the Word session.

FeatureInstall

Read/write MsoFeatureInstall

Returns or sets how Microsoft Word handles calls to methods and properties that require features not yet installed. Can be one of the following MsoFeatureInstall constants.
Remarks
You can use the msoFeatureInstallOnDemandWithUI constant to prevent users from believing that the application isn't responding while a feature is being installed. Use the msoFeatureInstallNone constant if you want the developer to be the only one who can install features.
If you have the DisplayAlerts property set to False, users will not be prompted to install new features even if the FeatureInstall property is set to msoFeatureInstallOnDemand. If the DisplayAlerts property is set to True, an installation progress meter will appear if the FeatureInstall property is set to msoFeatureInstallOnDemand.

FileConverters

Read-only FileConverters collection

Returns a FileConverters collection that represents all the file converters available to Word.

FileDialog­(FileDialogType)

FileDialog object

Returns a FileDialog object which represents a single instance of a file dialog box.
FileDialogType   Required MsoFileDialogType . The type of dialog.

FileSearch

FileSearch object

Returns a FileSearch object that can be used to search for files using either an absolute or relative path.

FindKey(

KeyCode,

KeyCode2

)

Read-only KeyBinding object

Returns a KeyBinding object that represents the specified key combination.
KeyCode    Required Long A key you specify by using one of the WdKey constants.
KeyCode2    Optional Variant A second key you specify by using one of the WdKey constants.
Remarks
You can use the BuildKeyCode method to create the KeyCode or KeyCode2 argument.

FocusInMailHeader

Read-only Boolean

True if the insertion point is in an e-mail header field (the To: field, for example).

FontNames

Read-only FontNames object

Returns a FontNames object that includes the names of all the available fonts.

Height

Read/write Long

Returns or sets the height of the active document window.

International­ (Index)

Read-only Variant

Returns information about the current country/region and international settings.
Index    Required WdInternationalIndex. The current country/region and/or international setting.

IsObjectValid

Read-only Boolean

True if the specified variable that references an object is valid. False if the object referenced by the variable has been deleted.

KeyBindings

KeyBindings collection

Returns a KeyBindings collection that represents customized key assignments, which include a key code, a key category, and a command.

KeysBoundTo(

KeyCategory,

Command, CommandParameter)

 

KeysBoundTo object

Returns a KeysBoundTo object that represents all the key combinations assigned to the specified item.
KeyCategory    Required WdKeyCategory. The category of the key combination.
Command    Required String The name of the command.
CommandParameter    Optional Variant Additional text, if any, required for the command specified by Command. For more information, see the "Remarks" section in the Add method for the KeyBindings object.

LandscapeFontNames

FontNames object

Returns a FontNames object that includes the names of all the available landscape fonts.

Language

MsoLanguageID constant

Returns an MsoLanguageID constant that represents the language selected for the Microsoft Word user interface.
Remarks
The value of this property is the same as the value returned by the following expression:

Application.LanguageSettings _
    .LanguageID(msoLanguageIDUI)

Languages

Languages collection

Returns a Languages collection that represents the proofing languages listed in the Language dialog box (on the Tools menu, click Language, and then click Set Language).

LanguageSettings

LanguageSettings object

Returns a LanguageSettings object, which contains information about the language settings in Microsoft Word.

Left

Read/write Long

Returns or sets a Long that represents the horizontal position of the active document (for the Application object) or the specified task or window, measured in points.

ListGalleries

ListGalleries collection

Returns a ListGalleries collection that represents the three list template galleries (Bulleted, Numbered, and Outline Numbered). Each gallery corresponds to a tab in the Bullets and Numbering dialog box (Format menu).

MacroContainer

Template or Document object

Returns a Template or Document object that represents the template or document in which the module that contains the running procedure is stored.

MailingLabel

MailingLabel object

Returns a MailingLabel object that represents a mailing label.

MailMessage

MailMessage object

Returns a MailMessage object that represents the active e-mail message.

MailSystem

Read-only WdMailSystem

Returns the mail system (or systems) installed on the host machine.
Remarks
Some of the constants listed above are available only in Microsoft Office Macintosh Edition. For additional information about these constants, consult the language reference Help included with Microsoft Office Macintosh Edition.

MAPIAvailable

Read-only Boolean

True if MAPI is installed.

MathCoprocessor­Available

Read-only Boolean

True if a math coprocessor is installed and available to Microsoft Word.

MouseAvailable

Read-only Boolean

True if there's a mouse available for the system.

Name

read-only String

Returns the name of the specified object.

NewDocument

NewFile object

Returns a NewFile object that represents a document listed on the New Document task pane.

NormalTemplate

Template object

Returns a Template object that represents the Normal template.

NumLock

Read-only Boolean

Returns the state of the NUM LOCK key. True if the keys on the numeric keypad insert numbers, False if the keys move the insertion point.

Options

Options object

Returns an Options object that represents application settings in Microsoft Word.

Parent

object

Returns an object that represents the parent object of the specified object.

Path

Read-only String

Returns the disk or Web path to the specified object.
Remarks
The path doesn't include a trailing character — for example, "C:\MSOffice" or "http://MyServer". Use the PathSeparator property to add the character that separates folders and drive letters. Use the Name property to return the file name without the path and use the FullName property to return the file name and the path together.
Note  You can use the PathSeparator property to build Web addresses even though they contain forward slashes (/) and the PathSeparator property defaults to a backslash (\).

PathSeparator

Read-only String

Returns the character used to separate folder names. This property returns a backslash (\).
Remarks
You can use PathSeparator property to build Web addresses even though they contain forward slashes (/).
The FullName property returns the path and file name as a single String

PortraitFontNames

FontNames object

Returns a FontNames object that includes the names of all the available portrait fonts.

PrintPreview

Read/write Boolean

True if print preview is the current view.

RecentFiles

RecentFiles collection

Returns a RecentFiles collection that represents the most recently accessed files.

ScreenUpdating

Read/write Boolean

True if screen updating is turned on.
Remarks
The ScreenUpdating property controls most display changes on the monitor while a procedure is running. When screen updating is turned off, toolbars remain visible and Word still allows the procedure to display or retrieve information using status bar prompts, input boxes, dialog boxes, and message boxes. You can increase the speed of some procedures by keeping screen updating turned off. You must set the ScreenUpdating property to True when the procedure finishes or when it stops after an error.

Selection

Read-only Selection object

Returns the Selection object that represents a selected range or the insertion point.

ShowStartupDialog

Read/write Boolean

True to display the Task Pane when starting Microsoft Word.
Remarks
The ShowStartupDialog is a global option, and the new setting will take effect only after you restart Word. Use the Visible property of the CommandBars collection show or hide the Task Pane without restarting Word.

ShowVisual­BasicEditor

Read/write Boolean

True if the Visual Basic Editor window is visible.

ShowWindows­InTaskbar

Read/write Boolean

True displays opened documents in the task bar, the default Single Document Interface (SDI). False lists opened documents only in the Window menu, providing the appearance of a Multiple Document Interface (MDI).

SmartTag­Recognizers

SmartTagRecognizers collection

Returns a SmartTagRecognizers collection for an application.

SmartTagTypes

SmartTagTypes collection

Returns a SmartTagTypes collection that represents the smart tag types for the smart tag components installed in Microsoft Word.
Remarks
A smart tag type is a single item in a smart tag component. Smart tag components can contain multiple smart tag types. For example, the Address (English) smart tag list installed on English systems by default contains a name smart tag type, a street smart tag type, and a city smart tag type, to name just a few. The SmartTagTypes collection contains all smart tag types for all components installed on a user's machine.

SpecialMode

Read-only Boolean

True if Microsoft Word is in a special mode (for example, CopyText mode or MoveText mode).
Remarks
Word enters a special copy or move mode if you press F2 or SHIFT+F2 while text is selected.

StartupPath

Read/write String

Returns or sets the complete path of the startup folder, excluding the final separator.
Remarks
Templates and add-ins located in the Startup folder are automatically loaded when you start Word.

StatusBar

Write-only String

Displays the specified text in the status bar.

SynonymInfo

(Word, LanguageID)

 

Returns a SynonymInfo object that contains information from the thesaurus on synonyms, antonyms, or related words and expressions for the specified word or phrase.
Word   Required String The specified word or phrase.
LanguageID   Optional Variant The language used for the thesaurus. Can be one of the WdLanguageID constants (although some of the constants listed may not be available to you, depending on the language support (U.S. English, for example) that you've selected or installed).

System

System object

Returns a System object, which can be used to return system-related information and perform system-related tasks.

TaskPanes

TaskPanes object

Returns a TaskPanes object that represents the most commonly performed tasks in Microsoft Word.

Tasks

Tasks collection

Returns a Tasks collection that represents all the applications that are running.

Templates

Templates collection

Returns a Templates collection that represents all the available templates — global templates as well as those attached to open documents.

Top

Read/write Long

Returns or sets the vertical position of the active document (for the Application object) or the specified task or window, in points.

UsableHeight

Read-only Long

Returns the maximum height (in points) to which you can set the height of a Microsoft Word document window.

UsableWidth

Read-only Long

Returns the maximum width (in points) to which you can set the width of a Microsoft Word document window.

UserAddress

Read/write String

Returns or sets the user's mailing address.
Remarks
The mailing address is used as a return address on envelopes.

UserControl

read-only Boolean

True if the document or application was created or opened by the user. False if the document or application was created or opened programmatically from another Microsoft Office application with the Open method or the CreateObject or GetObject method.
Remarks
If Word is visible to the user, or if you call the UserControl property of a Word Application or Document object from within a Word code module, this property will always return True.

UserInitials

Read/write String

Returns or sets the user's initials, which Microsoft Word uses to construct comment marks.

UserName

Read/write String

Returns or sets the user's name, which is used on envelopes and for the Author document property.

VBE

VBE object

Returns a VBE object that represents the Visual Basic Editor.

Version

Read-only String

Application object: Returns the Microsoft Word version number.

Visible

Read/write Boolean

True if the specified object is visible.
Remarks
For any object, some methods and properties may be unavailable if the Visible property is False.

Width

Read/write Long

Returns or sets the width of the specified object, in points.

Windows

Read-only Windows collection

Returns a Windows collection that represents all document windows. The collection corresponds to the window names that appear at the bottom of the Window menu.

 

WindowState

Read/write WdWindowState

Returns or sets the state of the specified document window or task window.
Remarks
The wdWindowStateNormal constant indicates a window that's not maximized or minimized. The state of an inactive window cannot be set. Use the Activate method to activate a window prior to setting the window state.

WordBasic

Read-only Automation object (Word.Basic)

Returns an Automation object (Word.Basic) that includes methods for all the WordBasic statements and functions available in Word version 6.0 and Word for Windows 95.
Remarks
In Word 2000 and later, when you open a Word version 6.0 or Word for Windows 95 template that contains WordBasic macros, the macros are automatically converted to Visual Basic modules. Each WordBasic statement and function in the macro is converted to the corresponding Word.Basic method.
For information about WordBasic statements and functions, see WordBasic Help in Word version 6.0 or Word for Windows 95.
For information about converting WordBasic to Visual Basic, see Visual Basic Equivalents for WordBasic Commands .

XMLNamespaces

XMLNamespaces collection

Returns an XMLNamespaces collection that represents the XML schemas in the Schema Library.

Application Object Methods

The following table lists Application object methods.

Method

Description

Activate

Activates the specified object.

AddAddress(
TagID,
Value
)
 

Adds an entry to the address book. Each entry has values for one or more tag IDs.
TagID    Required String array. The tag ID values for the new address entry. Each element in the array can contain one of the strings listed in the following table. Only the display name is required; the remaining entries are optional.
Value    Required String array. The values for the new address entry. Each element corresponds to an element in the TagID array. For more information, see the example.

AutomaticChange

Performs an AutoFormat action when there's a change suggested by the Office Assistant. If no AutoFormat action is active, this method generates an error.

BuildKeyCode(Arg1, Arg2, Arg3, Arg4)

 

Returns a unique number for the specified key combination.
Arg1   Required WdKey . A key you specify by using one of the WdKey constants.
Arg2 - Arg4   Optional WdKey . A key you specify by using one of the WdKey constants.

CentimetersToPoints

Converts a measurement from centimeters to points (1 cm = 28.35 points). Returns the converted measurement as a Single.

ChangeFile­OpenDirectory­ (Path)

Sets the folder in which Word searches for documents. The specified folder's contents are listed the next time the Open dialog box (File menu) is displayed.
Note  Word searches the specified folder for documents until the user changes the folder in the Open dialog box or the current Word session ends. Use the DefaultFilePath property to change the default folder for documents in every Word session.
Path    Required String The path to the folder in which Word searches for documents.

CheckGrammar(String)

 

Checks a string for grammatical errors. Returns a Boolean to indicate whether the string contains grammatical errors. True if the string contains no errors.
String   Required String The string you want to check for grammatical errors.

CheckSpelling

(Word, CustomDictionary, IgnoreUppercase, MainDictionary, CustomDictionary2, CustomDictionary3, CustomDictionary4, CustomDictionary5, CustomDictionary6, CustomDictionary7, CustomDictionary8, CustomDictionary9, CustomDictionary10)

Checks a string for spelling errors. Returns a Boolean to indicate whether the string contains spelling errors. True if the string has no spelling errors.
Word   Required String The text whose spelling is to be checked.
CustomDictionary   Optional Variant Either an expression that returns a Dictionary object or the file name of the custom dictionary.
IgnoreUppercase   Optional Variant True if capitalization is ignored. If this argument is omitted, the current value of the IgnoreUppercase property is used.
MainDictionary   Optional Variant Either an expression that returns a Dictionary object or the file name of the main dictionary.
CustomDictionary2 – CustomDictionary10    Optional Variant Either an expression that returns a Dictionary object or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.

CleanString(String)

Removes nonprinting characters (character codes 1 – 29) and special Word characters from the specified string or changes them to spaces (character code 32), as described in the "Remarks" section. Returns the result as a String
String    Required String The source String
Remarks
The following characters are converted as described in this table.

DDEExecute(
Channel,
Command)

Sends a command or series of commands to an application through the specified dynamic data exchange (DDE) channel.
Security  Dynamic data exchange (DDE) is an older technology that is not secure. If possible, use a more secure alternative to DDE, such as object linking and embedding (OLE).
Channel    Required Long The channel number returned by the DDEInitiate method.
Command    Required String A command or series of commands recognized by the receiving application (the DDE server). If the receiving application cannot perform the specified command, an error occurs.

DDEInitiate(App, Topic)

Opens a dynamic data exchange (DDE) channel to another application, and returns the channel number.
Security  Dynamic data exchange (DDE) is an older technology that is not secure. If possible, use a more secure alternative to DDE, such as object linking and embedding (OLE).
App    Required String The name of the application.
Topic    Required String The name of a DDE topic — for example, the name of an open document — recognized by the application to which you're opening a channel.
Remarks
If it's successful, the DDEInitiate method returns the number of the open channel. All subsequent DDE functions use this number to specify the channel.

DDEPoke(
Channel,
Item,
Data)

Uses an open dynamic data exchange (DDE) channel to send data to an application.
Security  Dynamic data exchange (DDE) is an older technology that is not secure. If possible, use a more secure alternative to DDE, such as object linking and embedding (OLE).
Channel    Required Long The channel number returned by the DDEInitiate method.
Item    Required String The item within a DDE topic to which the specified data is to be sent.
Data    Required String The data to be sent to the receiving application (the DDE server).
Remarks
If the DDEPoke method isn't successful, an error occurs.

DDERequest(
Channel,
Item)

Uses an open dynamic data exchange (DDE) channel to request information from the receiving application, and returns the information as a String
Security  Dynamic data exchange (DDE) is an older technology that is not secure. If possible, use a more secure alternative to DDE, such as object linking and embedding (OLE).
Channel    Required Long The channel number returned by the DDEInitiate method.
Item    Required String The item to be requested.
Remarks
When you request information from the topic in the server application, you must specify the item in that topic whose contents you're requesting. In Microsoft Excel, for example, cells are valid items, and you refer to them by using either the "R1C1" format or named references.
Microsoft Excel and other applications that support DDE recognize a topic named "System." Three standard items in the System topic are described in the following table. Note that you can get a list of the other items in the System topic by using the SysItems item.

Item in System topic

Effect

SysItems

Returns a list of all the items in the System topic.

Topics

Returns a list of all the available topics.

Formats

Returns a list of all the Clipboard formats supported by Word.

 

DDETerminate(Channel)

Closes the specified dynamic data exchange (DDE) channel to another application.
Security  Dynamic data exchange (DDE) is an older technology that is not secure. If possible, use a more secure alternative to DDE, such as object linking and embedding (OLE).
Channel    Required Long The channel number returned by the DDEInitiate method.

DDETerminateAll

Closes all dynamic data exchange (DDE) channels opened by Word. This method doesn't close channels opened to Word by client applications. Using this method is the same as using the DDETerminate method for each open channel.
Security  Dynamic data exchange (DDE) is an older technology that is not secure. If possible, use a more secure alternative to DDE, such as object linking and embedding (OLE).
Remarks
If you interrupt a macro that opens a DDE channel, you may inadvertently leave a channel open. Open channels aren't closed automatically when a macro ends, and each open channel uses system resources. For this reason, it's a good idea to use this method when you're debugging a macro that opens one or more DDE channels.

DefaultWebOptions

Returns the DefaultWebOptions object that contains global application-level attributes used by Microsoft Word whenever you save a document as a Web page or open a Web page.

GetAddress(Name, AddressProperties, UseAutoText, DisplaySelectDialog, SelectDialog, CheckNamesDialog, RecentAddressesChoice, UpdateRecentAddresses)

 

Returns an address from the default address book.
Name    Optional Variant The name of the addressee, as specified in the Search Name dialog box in the address book.
AddressProperties    Optional Variant If UseAutoText is True, this argument denotes the name of an AutoText entry that defines a sequence of address book properties. If UseAutoText is False or omitted, this argument defines a custom layout. Valid address book property names or sets of property names are surrounded by angle brackets ("<" and ">") and separated by a space or a paragraph mark (for example, "<PR_GIVEN_NAME> <PR_SURNAME>" & vbCr & "<PR_OFFICE_TELEPHONE_NUMBER>").

If this argument is omitted, default AutoText entry named "AddressLayout" is used. If "AddressLayout" hasn't been defined, the following address layout definition is used: "<PR_GIVEN_NAME> <PR_SURNAME>" & vbCr & "<PR_STREET_ADDRESS>" & vbCr & "<PR_LOCALITY>" & ", " & "<PR_STATE_OR_PROVINCE>" & " " & "<PR_POSTAL_CODE>" & vbCr & "<PR_COUNTRY>".

For a list of the valid address book property names, see the AddAddress method.

UseAutoText    Optional Variant True if AddressProperties specifies the name of an AutoText entry that defines a sequence of address book properties; False if it specifies a custom layout.
DisplaySelectDialog    Optional Variant Specifies whether the Select Name dialog box is displayed, as shown in the following table.

Value

Result

0 (zero)

The Select Name dialog box isn't displayed.

1 or omitted

The Select Name dialog box is displayed.

2

The Select Name dialog box isn't displayed, and no search for a specific name is performed. The address returned by this method will be the previously selected address.

SelectDialog    Optional Variant Specifies how the Select Name dialog box should be displayed (that is, in what mode), as shown in the following table.

Value

Display mode

0 (zero) or omitted

Browse mode

1

Compose mode, with only the To: box

2

Compose mode, with both the To: and CC: boxes

CheckNamesDialog    Optional Variant True to display the Check Names dialog box when the value of the Name argument isn't specific enough.
RecentAddressesChoice    Optional Variant True to use the list of recently used return addresses.
UpdateRecentAddresses    Optional Variant True to add an address to the list of recently used addresses; False to not add the address. If SelectDialog is set to 1 or 2, this argument is ignored.

GetDefaultTheme­ (DocumentType)

Returns a String that represents the name of the default theme plus the theme formatting options Microsoft Word uses for new documents, e-mail messages, or Web pages.
DocumentType   Required The type of new document for which you want to retrieve the default theme name. WdDocumentMedium .
Remarks
You can also use the ThemeName property to return and set the default theme for new e-mail messages.

GetSpelling Suggestions­ (Word, CustomDictionary, IgnoreUppercase, MainDictionary, SuggestionMode, CustomDictionary2, CustomDictionary3, CustomDictionary4, CustomDictionary5, CustomDictionary6, CustomDictionary7, CustomDictionary8, CustomDictionary9, CustomDictionary10)

 

Returns a SpellingSuggestions collection that represents the words suggested as spelling replacements for a given word.
Word   Required String The word whose spelling is to be checked.
CustomDictionary   Optional Variant Either an expression that returns a Dictionary object or the file name of the custom dictionary.
IgnoreUppercase   Optional Variant True to ignore words in all uppercase letters. If this argument is omitted, the current value of the IgnoreUppercase property is used.
MainDictionary   Optional Variant Either an expression that returns a Dictionary object or the file name of the main dictionary. If you don't specify a main dictionary, Microsoft Word uses the main dictionary that corresponds to the language formatting of Word or of the first word in the range.
SuggestionMode   Optional Variant Specifies the way Word makes spelling suggestions. Can be one of the following WdSpellingWordType constants. The default value is WdSpellword.
CustomDictionary2 – CustomDictionary10    Optional Variant Either an expression that returns a Dictionary object or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.
Remarks
If the word is spelled correctly, the Count property of the SpellingSuggestions object returns 0 (zero).

GoBack

Moves the insertion point among the last three locations where editing occurred in the active document (the same as pressing SHIFT+F5).

GoForward

Moves the insertion point forward among the last three locations where editing occurred in the active document.

Help(HelpType)

Displays on-line Help information.
HelpType    Required Variant The on-line Help topic or window. Can be any of these WdHelpType constants.
Remarks
Some of the constants listed above may not be available to you, depending on the language support (U.S. English, for example) that you've selected or installed.

HelpTool

Changes the pointer from an arrow to a question mark, indicating that you'll get context-sensitive Help information about the next command or screen element you click. If you click text, Word displays a box describing current paragraph and character formats. Pressing ESC turns the pointer back to an arrow.

InchesToPoints(Inches)

Converts a measurement from inches to points (1 inch = 72 points). Returns the converted measurement as a Single.
Inches    Required Single. The inch value to be converted to points.

Keyboard(LangId)

Returns or sets the keyboard language and layout settings.
LangId    Optional Long The language and layout combination to which Microsoft Word sets the keyboard. If this argument is omitted, the method returns the current language and layout setting.
Remarks
Microsoft Windows tracks keyboard language and layout settings using a variable type called an input language handle, often referred to as an HKL. The low word of the handle is a language ID, and the high word is a handle to a keyboard layout.

KeyboardBidi

Sets the keyboard language to a right-to-left language and the text entry direction to right-to-left.
Remarks
For more information on using Microsoft Word with right-to-left languages, see Word features for right-to-left languages .

KeyboardLatin

Sets the keyboard language to a left-to-right language and the text entry direction to left-to-right.
Remarks
For more information on using Microsoft Word with right-to-left languages, see Word features for right-to-left languages .

KeyString(
KeyCode,
KeyCode2
)
 

Returns the key combination string for the specified keys (for example, CTRL+SHIFT+A).
KeyCode    Required Long A key you specify by using one of the WdKey constants.
KeyCode2    Optional Variant A second key you specify by using one of the WdKey constants.
Remarks
You can use the BuildKeyCode method to create the KeyCode or KeyCode2 argument.

LinesToPoints(Lines)

Converts a measurement from lines to points (1 line = 12 points). Returns the converted measurement as a Single.
Lines    Required Single. The line value to be converted to points.

ListCommands­ (ListAllCommands)

Creates a new document and then inserts a table of Word commands along with their associated shortcut keys and menu assignments.
ListAllCommands    Required Boolean True to include all Word commands and their assignments (whether customized or built-in). False to include only commands with customized assignments.

LookupName Properties­ (Name)

Looks up a name in the global address book list and displays the Properties dialog box, which includes information about the specified name. If this method finds more than one match, it displays the Check Names dialog box.
Name   Required String A name in the global address book.

MillimetersToPoints­ (Millimeters)

Converts a measurement from millimeters to points (1 mm = 2.85 points). Returns the converted measurement as a Single.
Millimeters    Required Single. The millimeter value to be converted to points.

Move(Left, Top)

Positions a task window or the active document window.
Left   Required Long The horizontal screen position of the specified window.
Top   Required Long The vertical screen position of the specified window.

NewWindow

Opens a new window with the same document as the specified window. Returns a Window object.
Note  A colon (:) and a number appear in the window caption when more than one window is open for a document.
Remarks

If the NewWindow method is used with the Application object, a new window is opened for the active window.
The following two instructions are functionally equivalent.

OnTime(When, Name, Tolerance)

Starts a background timer that runs a macro at a specified time.
When    Required Variant The time at which the macro is to be run. Can be a string that specifies a time (for example, "4:30 pm" or "16:30"), or it can be a serial number returned by a function such as TimeValue or TimeSerial (for example, TimeValue("2:30 pm") or TimeSerial(14, 30, 00)). You can also include the date (for example, "6/30 4:15 pm" or TimeValue("6/30 4:15 pm")).
Use the sum of the return values of the Now function and either the TimeValue or TimeSerial function to set a timer to run a macro a specified amount of time after the statement is run. For example, use Now+TimeValue("00:05:30") to run a macro 5 minutes and 30 seconds after the statement is run.
Name    Required String The name of the macro to be run. Use the complete macro path to ensure that the correct macro is run (for example, "Project.Module1.Macro1"). For the macro to run, the document or template must be available both when the OnTime instruction is run and when the time specified by When arrives. For this reason, it's best to store the macro in Normal.dot or another global template that's loaded automatically.
Tolerance    Optional Variant The maximum time (in seconds) that can elapse before a macro that wasn't run at the time specified by When is canceled. Macros may not always run at the specified time. For example, if a sort operation is under way or a dialog box is being displayed, the macro will be delayed until Word has completed the task. If this argument is 0 (zero) or omitted, the macro is run regardless of how much time has elapsed since the time specified by When.
Remarks
Word can maintain only one background timer set by OnTime. If you start another timer before an existing timer runs, the existing timer is canceled.

OrganizerCopy(
Source,
Destination,
Name,
Object)
 

Copies the specified AutoText entry, toolbar, style, or macro project item from the source document or template to the destination document or template.
Source    Required String The document or template file name that contains the item you want to copy.
Destination    Required String The document or template file name to which you want to copy an item.
Name    Required String The name of the AutoText entry, toolbar, style, or macro you want to copy.
Object   Required WdOrganizerObject . The kind of item you want to copy.

OrganizerDelete(
Source,
Name,
Object)
 

Deletes the specified style, AutoText entry, toolbar, or macro project item from a document or template.
Source    Required String The file name of the document or template that contains the item you want to delete.
Name    Required String The name of the style, AutoText entry, toolbar, or macro you want to delete.
Object   Required WdOrganizerObject . The kind of item you want to copy.

OrganizerRename(
Source,
Name,
NewName,
Object)Remarks

Renames the specified style, AutoText entry, toolbar, or macro project item in a document or template.
Source    Required String The file name of the document or template that contains the item you want to rename.
Name    Required String The name of the style, AutoText entry, toolbar, or macro you want to rename.
NewName    Required String The new name for the item.
Object   Required WdOrganizerObject . The kind of item you want to rename

PicasToPoints(Picas)

Converts a measurement from picas to points (1 pica = 12 points). Returns the converted measurement as a Single.
Picas    Required Single. The pica value to be converted to points.

PixelsToPoints(
Pixels,
fVertical
)

Converts a measurement from pixels to points. Returns the converted measurement as a Single.
Pixels    Required Single. The pixel value to be converted to points.
fVertical    Optional Variant True to convert vertical pixels; False to convert horizontal pixels.

PointsToCentimeters (Points)

Converts a measurement from points to centimeters (1 centimeter = 28.35 points). Returns the converted measurement as a Single.
Points    Required Single. The measurement, in points.

PointsToInches(Points)

Converts a measurement from points to inches (1 inch = 72 points). Returns the converted measurement as a Single.
Points    Required Single. The measurement, in points.

PointsToLines(Points)

Converts a measurement from points to lines (1 line = 12 points). Returns the converted measurement as a Single.
Points    Required Single. The measurement, in points.

PointsToMillimeters­ (Points)

Converts a measurement from points to millimeters (1 millimeter = 2.835 points). Returns the converted measurement as a Single.
Points    Required Single. The measurement, in points.

PointsToPicas(Points)

Converts a measurement from points to picas (1 pica = 12 points). Returns the converted measurement as a Single.
Points    Required Single. The measurement, in points.

PointsToPixels (
Points,
fVertical
)

Converts a measurement from points to pixels. Returns the converted measurement as a Single.
Points    Required Single. The point value to be converted to pixels.
fVertical    Optional Variant True to return the result as vertical pixels; False to return the result as horizontal pixels.

PrintOut(
Background,
Append,
Range,
OutputFileName,
From,
To,
Item,
Copies,
Pages,
PageType,
PrintToFile,
Collate,
FileName, ActivePrinterMacGX, ManualDuplexPrint, PrintZoomColumn, PrintZoomRow, PrintZoomPaperWidth, PrintZoomPaperHeight)

Prints all or part of the specified document.
Background   Optional Variant Set to True to have the macro continue while Microsoft Word prints the document.
Append   Optional Variant Set to True to append the specified document to the file name specified by the OutputFileName argument. False to overwrite the contents of OutputFileName.
Range   Optional Variant The page range. Can be any WdPrintOutRange constant.
OutputFileName   Optional Variant If PrintToFile is True, this argument specifies the path and file name of the output file.
From   Optional Variant The starting page number when Range is set to wdPrintFromTo.
To   Optional Variant The ending page number when Range is set to wdPrintFromTo.
Item   Optional Variant The item to be printed. Can be any WdPrintOutItem constant.
Copies   Optional Variant The number of copies to be printed.
Pages   Optional Variant The page numbers and page ranges to be printed, separated by commas. For example, "2, 6-10" prints page 2 and pages 6 through 10.
PageType   Optional Variant The type of pages to be printed. Can be any WdPrintOutPages constant.
PrintToFile   Optional Variant True to send printer instructions to a file. Make sure to specify a file name with OutputFileName.
Collate   Optional Variant When printing multiple copies of a document, True to print all pages of the document before printing the next copy.
FileName   Optional Variant The path and file name of the document to be printed. If this argument is omitted, Word prints the active document. (Available only with the Application object.)
ActivePrinterMacGX   Optional Variant This argument is available only in Microsoft Office Macintosh Edition. For additional information about this argument, consult the language reference Help included with Microsoft Office Macintosh Edition.
ManualDuplexPrint   Optional Variant True to print a two-sided document on a printer without a duplex printing kit. If this argument is True, the PrintBackground and PrintReverse properties are ignored. Use the PrintOddPagesInAscendingOrder and PrintEvenPagesInAscendingOrder properties to control the output during manual duplex printing. This argument may not be available to you, depending on the language support (U.S. English, for example) that you've selected or installed.
PrintZoomColumn   Optional Variant The number of pages you want Word to fit horizontally on one page. Can be 1, 2, 3, or 4. Use with the PrintZoomRow argument to print multiple pages on a single sheet.
PrintZoomRow   Optional Variant The number of pages you want Word to fit vertically on one page. Can be 1, 2, or 4. Use with the PrintZoomColumn argument to print multiple pages on a single sheet.
PrintZoomPaperWidth   Optional Variant The width to which you want Word to scale printed pages, in twips (20 twips = 1 point; 72 points = 1 inch).
PrintZoomPaperHeight   Optional Variant The height to which you want Word to scale printed pages, in twips (20 twips = 1 point; 72 points = 1 inch).

ProductCode

Returns the Microsoft Word globally unique identifier (GUID) as a String

PutFocus­InMailHeader

Places the insertion point in the To line of the mail header if the document in the active window is an e-mail document.
Remarks
For best results, use the PutFocusInMailHeader method with the EnvelopeVisible property. When the EnvelopeVisible property is set to True, the PutFocusInMailHeader method will place the insertion point in the mail header.

Quit(
SaveChanges,
Format,
RouteDocument)

Quits Microsoft Word and optionally saves or routes the open documents.
SaveChanges    Optional Variant Specifies whether Word saves changed documents before quitting. Can be one of the WdSaveOptions constants.
OriginalFormat    Optional Variant Specifies the way Word saves documents whose original format was not Word Document format. Can be one of the WdOriginalFormat constants.
RouteDocument    Optional Variant True to route the document to the next recipient. If the document doesn't have a routing slip attached, this argument is ignored.

Repeat(Times)

Repeats the most recent editing action one or more times. Returns True if the commands were repeated successfully.
Note   Using this method is the equivalent to using the Repeat command on the Edit menu.
Times    Optional Variant The number of times you want to repeat the last command.

ResetIgnoreAll

Clears the list of words that were previously ignored during a spelling check. After you run this method, previously ignored words are checked along with all the other words.
Remarks
In order for the ResetIgnoreAll method to work, you must first set the SpellingChecked property to False.

Resize(Width, Height)

Sizes the Word application window or the specified task window. If the window is maximized or minimized, an error occurs.
Note  Use the Width or Height property to set the window width and height independently.
Width    Required Long The width of the window, in points.
Height    Required Long The height of the window, in points.

Run(
MacroName,
varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14, varg15, varg16, varg17, varg18, varg19, varg20, varg21, varg22, varg23, varg24, varg25, varg26, varg27, varg28, varg29, varg30)

Runs a Visual Basic macro.
MacroName    Required String The name of the macro. Can be any combination of template, module, and macro name. For example, the following statements are all valid.

Application.Run "Normal.Module1.MAIN"
Application.Run "MyProject.MyModule.MyProcedure"
Application.Run "'My Document.doc'!ThisModule.ThisProcedure"

If you specify the document name, your code can only run macros in documents related to the current context — not just any macro in any document.

varg1...varg30    Optional Variant Macro parameter values. You can pass up to 30 parameter values to the specified macro.
Remarks
Although Visual Basic code can call a macro directly (without using the Run method), this method is useful when the macro name is stored in a variable. (For more information, see the example for this topic). The following three statements are functionally equivalent. The first two statements require a reference to Normal.dot, the project in which the called macro resides; the third statement, which uses the Run method, does not require a reference to the Normal.dot project.

ScreenRefresh

Updates the display on the monitor with the current information in the video memory buffer. You can use this method after using the ScreenUpdating property to disable screen updates.
Remarks
ScreenRefresh turns on screen updating for just one instruction and then immediately turns it off. Subsequent instructions don't update the screen until screen updating is turned on again with the ScreenUpdating property.

SendFax

Starts the Fax Wizard.

SetDefaultTheme(
Name,
DocumentType
)
 

Sets a default theme for Microsoft Word to use with new documents, e-mail messages, or Web pages.
Name   Required String The name of the theme you want to assign as the default theme plus any theme formatting options you want to apply. The format of this string is "theme nnn" where theme and nnn are defined as follows:

String

Description

theme

The name of the folder that contains the data for the requested theme. (The default location for theme data folders is C:\Program Files\Common Files\Microsoft Shared\Themes.) You must use the folder name for the theme rather than the display name that appears in the Theme dialog box (Theme command, Format menu).

nnn

A three-digit string that indicates which theme formatting options to activate (1 to activate, 0 to deactivate). The digits correspond to the Vivid Colors, Active Graphics, and Background Image check boxes in the Theme dialog box (Theme command, Format menu). If this string is omitted, the default value for nnn is "011" (Active Graphics and Background Image are activated).

DocumentType   Required WdDocumentMedium . The type of new document to which you are assigning a default theme.

Remarks
Setting a default theme will not apply that theme to the blank document automatically created when you start Word. Any new documents you create after that will have the default theme.
You can also use the ThemeName property to return and set the default theme for new e-mail messages.

ShowClipboard

Displays the Clipboard task pane.

ShowMe

Displays the Office Assistant or the Help window when there's more information available. If additional information isn't available, this method generates a message that no associated Help topic exists.

SubstituteFont(
UnavailableFont, SubstituteFont
)

Sets font-mapping options, which are reflected in the Font Substitution dialog box (Compatibility tab, Options dialog box, Tools menu).
UnavailableFont    Required String The name of a font not available on your computer that you want to map to a different font for display and printing.
SubstituteFont    Required String The name of a font available on your computer that you want to substitute for the unavailable font.

ToggleKeyboard

Switches the keyboard language setting between right-to-left and left-to-right languages.
RemarksFor more information on using Microsoft Word with right-to-left languages, see Word features for right-to-left languages .

 

Application Object Events

The following table lists Application object events.

Prefix "object" below means an object of type Application declared with events in a class module. For more information about using events with the Application object, see Using Events with the Application Object .

The common arguments are

Doc - The document that causes event.

Cancel - False when the event occurs. If the event procedure sets this argument to True, the event will not be processed when the procedure is finished.

Event

Description

DocumentBeforeClose

Occurs immediately before any open document closes.

Private Sub object_DocumentBeforeClose(ByVal Doc As Document, Cancel As Boolean)

DocumentBeforePrint

Occurs before any open document is printed.

Private Sub object_DocumentBeforePrint(ByVal Doc As Document, Cancel As Boolean)

DocumentBeforeSave

Occurs before any open document is saved.

Private Sub object_DocumentBeforeSave(ByVal Doc As Document, SaveAsUI As Boolean, Cancel As Boolean)

SaveAsUI True to display the Save As dialog box.

DocumentChange

Occurs when a new document is created, when an existing document is opened, or when another document is made the active document.

Private Sub object_DocumentChange()

DocumentOpen

Occurs when a document is opened.

Private Sub object_DocumentOpen(ByVal Doc As Document)

DocumentSync

Occurs when the local copy of a document that is part of a Document Workspace is synchronized with the copy on the server.

Private Sub object_DocumentSync(Doc, SyncEventType)

SyncEventType    Required MsoSyncEventType. The status of the document synchronization.

EPostageInsert

Occurs when a user inserts electronic postage into a document.

Private Sub object_EPostageInsert(ByVal Doc As Document)

EPostageInsertEx

Occurs when a user inserts electronic postage into a document.

EPostageInsertEx(Doc, cpDeliveryAddrStart, cpDeliveryAddrEnd, cpReturnAddrStart, cpReturnAddrEnd, xaWidth, yaHeight, bstrPrinterName, bstrPaperFeed, fPrint, fCancel)

Doc    Required Document. The document to which electronic postage is being added.

cpDeliveryAddrStart     Long The starting position in the document for the delivery address. Positioning corresponds to the value of the Start property for a Range object.

cpDeliveryAddrEnd     Long The ending position in the document for the delivery address. Positioning corresponds to the value of the End property for a Range object.

cpReturnAddrStart     Long The starting position in the document for the return address. Positioning corresponds to the value of the Start property for a Range object.

cpReturnAddrEnd     Long The ending position in the document for the return address. Positioning corresponds to the value of the End property for a Range object.

xaWidth     Long The width of the envelope in 1/1440-inch units.

yaHeight     Long The height of the envelope in 1/1440-inch units.

bstrPrinterName     String The name of the printer as specified on the Printing Options tab of the Envelope Options dialog box.

bstrPaperFeed     String The feed method as specified on the Printing Options tab of the Envelope Options dialog box.

fPrint     Boolean True if the user has specified to print the envelope. False if the user has specified to insert the envelope into the document.

fCancel     Boolean True cancels the action the user specified as indicated in the fPrint parameter.

EPostagePropertyDialog

Occurs when a user clicks the E-postage Properties (Labels and Envelopes dialog box) button or Print Electronic Postage toolbar button. This event allows a third-party software application to intercept and show their properties dialog box.

Private Sub object_EPostagePropertyDialog(ByVal Doc As Document)

MailMergeAfterMerge

Occurs after all records in a mail merge have merged successfully.

Private Sub object_MailMergeAfterMerge(ByVal Doc As Document, ByVal DocResult As Document)

DocResult The document created from the mail merge.

MailMerge
AfterRecordMerge

Occurs after each record in the data source successfully merges in a mail merge.

Private Sub object_MailMergeAfterRecordMerge(ByVal Doc As Document)

Doc The mail merge main document.

MailMergeBeforeMerge

Occurs when a merge is executed before any records merge.

Private Sub object_MailMergeBeforeMerge(ByVal Doc As Document, ByVal StartRecord As Long, ByVal EndRecord As Long, Cancel As Boolean)

Doc The mail merge main document.

StartRecord The first record in the data source to include in the mail merge.

EndRecord The last record in the data source to include in the mail merge.

Cancel True stops the mail merge process before it starts.

MailMerge
B
eforeRecordMerge

Occurs as a merge is executed for the individual records in a merge.

Private Sub object_MailMergeBeforeRecordMerge(ByVal Doc As Document, Cancel As Boolean)

Doc The mail merge main document.

Cancel True stops the mail merge process for the current record only before it starts.

MailMerge­DataSourceLoad

Occurs when the data source is loaded for a mail merge.

Private Sub object_MailMergeDataSourceLoad(ByVal Doc As Document)

Doc The mail merge main document.

MailMerge
D
ataSourceValidate

Occurs when a user performs address verification by clicking Validate in the Mail Merge Recipients dialog box.

Private Sub object_MailMergeDataSourceValidate(ByVal Doc As Document, Handled As Boolean)

Doc The mail merge main document.

Handled True runs the accompanying validation code against the mail merge data source. False cancels the data source validation.

Remarks

If you don't have address verification software installed on your computer, the MailMergeDataSourceValidate event allows you to create simple filtering routines, such as looping through records to check the postal codes and removing any that are non-U.S. Non-U.S. users can filter out all U.S. postal codes by modifying the code sample below and using Microsoft Visual Basic commands to search for text or special characters.

MailMergeWizard
SendToCustom

Occurs when the custom button is clicked on step six of the Mail Merge Wizard.

Private Sub object_MailMergeWizardSendToCustom(ByVal Doc As Document)

Doc The mail merge main document.

Remarks

Use the ShowSendToCustom property to create a custom button on the sixth step of the Mail Merge Wizard.

MailMergeWizard
StateChange

Occurs when a user changes from a specified step to a specified step in the Mail Merge Wizard.

Private Sub object_MailMergeWizardStateChange(ByVal Doc As Document, FromState As Long, ToState As Long, Handled As Boolean)

Doc The mail merge main document.

FromState The Mail Merge Wizard step from which a user is moving.

ToState The Mail Merge Wizard step to which a user is moving.

Handled True moves the user to the next step. False for the user to remain at the current step.

NewDocument

Occurs when a new document is created.

Private Sub object_NewDocument(ByVal Doc As Document)

Doc The new document.

Quit

Occurs when the user quits Word.

Private Sub object_Quit()

WindowActivate

Occurs when any document window is activated.

Private Sub object_WindowActivate(ByVal Doc As Word.Document, ByVal Wn As Word.Window)

Doc Used only with the Application object. The document displayed in the activated window.

Wn The window that's being activated.

WindowBeforeDoubleClick

Occurs when the editing area of a document window is double-clicked, before the default double-click action.

Private Sub object_WindowBeforeDoubleClick(ByVal Sel As Selection, Cancel As Boolean)

Sel The current selection.

Cancel False when the event occurs. If the event procedure sets this argument to True, the default double-click action does not occur when the procedure is finished.

WindowBeforeRightClick

Occurs when the editing area of a document window is right-clicked, before the default right-click action.

Private Sub object_WindowBeforeRightClick(ByVal Sel As Selection, Cancel As Boolean)

Sel The current selection.

Cancel False when the event occurs. If the event procedure sets this argument to True, the default right-click action does not occur when the procedure is finished.

WindowDeactivate

Occurs when any document window is deactivated.

Private Sub object_WindowDeactivate(ByVal Doc As Word.Document, ByVal Wn As Word.Window)

Doc Used only with the Application object. The document displayed in the deactivated window.

Wn The deactivated window.

WindowSelectionChange

Occurs when the selection changes in the active document window.

Private Sub object_WindowSelectionChange(ByVal Sel As Selection)

Sel The new selection.

WindowSize

Occurs when the application window is resized or moved.

Private Sub object_WindowSize(ByVal Doc As Document, ByVal Wn As Window)

Doc The document in the window being sized.

Wn The window being sized.

XMLSelectionChange

Occurs when the parent XML node of the current selection changes.

Private Sub object_XMLSelectionChange(Sel, OldXMLNode, NewXMLNode, Reason)

Sel   Selection. The text selected, including XML elements. If no text is selected, the Sel parameter returns either nothing or the first character to the right of the insertion point.

OldXMLNode   XMLNode. The XML node from which the insertion point is moving.

NewXMLNode   XMLNode. The XML node to which the insertion point is moving.

Reason   Required Long The reason why the selection has changed. Can be any of the wdXMLSelectionChange constants.

XMLValidationError

Occurs when there is a validation error in the document.

Private Sub object_XMLValidationError(XMLNode)

XMLNode   XMLNode. The XML element that is invalid.

 

Using Events with the Application Object

To create an event handler for an event of the Application object, you need to complete the following three steps:

1.            Declare an object variable in a class module to respond to the events.
2.            Write the specific event procedures.
3.            Initialize the declared object from another module.

The details are described below.

Declaring Variable "Application With Events"

Before you can write procedures for the events of the Application object, you must create a new class module and declare an object of type Application with events. For example, assume that a new class module is created and called EventClassModule. The new class module contains the following code.

Public WithEvents AhWordApp As Word.Application

Creating Event Handlers

After the new object has been declared with events, it appears in the Object drop-down list box in the class module, and you can write event procedures for the new object. (When you select the new object in the Object box, the valid events for that object are listed in the Procedure drop-down list box.) Select an event from the Procedure drop-down list box; an empty procedure is added to the class module.

Private Sub AhWordApp_DocumentChange()
 End Sub

Declaring and Initializing "Application With Events" Variable

Before the procedure will run, you must connect the declared object in the class module (AhWordApp in this example) with the Application object. You can do this with the following code from any module.

Dim XXX As New EventClassModule                // declaration
Set XXX.AhWordApp = Word.Application           // switch event handling on
Set XXX.AhWordApp = Nothing                    // switch event handling off

If you need to handle events during all life time of the template, insert the following code to the AutoExec and AutoExit macros.

Sub AutoExec ()
    Set XXX.AhWordApp = Word.Application
End Sub
Sub AutoExit ()
    Set XXX.AhWordApp = Nothing
End Sub

Wd Enumerations and Other Constants

Tag Ids for AddAddress method

Tag ID

Description

PR_DISPLAY_NAME

Name displayed in the Address Book dialog box

PR_DISPLAY_NAME_PREFIX

Title (for example, "Ms." or "Dr.")

PR_GIVEN_NAME

First name

PR_SURNAME

Last name

PR_STREET_ADDRESS

Street address

PR_LOCALITY

City or locality

PR_STATE_OR_PROVINCE

State or province

PR_POSTAL_CODE

Postal code

PR_COUNTRY

Country/Region

PR_TITLE

Job title

PR_COMPANY_NAME

Company name

PR_DEPARTMENT_NAME

Department name within the company

PR_OFFICE_LOCATION

Office location

PR_PRIMARY_TELEPHONE_NUMBER

Primary telephone number

PR_PRIMARY_FAX_NUMBER

Primary fax number

PR_OFFICE_TELEPHONE_NUMBER

Office telephone number

PR_OFFICE2_TELEPHONE_NUMBER

Second office telephone number

PR_HOME_TELEPHONE_NUMBER

Home telephone number

PR_CELLULAR_TELEPHONE_NUMBER

Cellular telephone number

PR_BEEPER_TELEPHONE_NUMBER

Beeper telephone number

PR_COMMENT

Text included on the Notes   tab for the address entry

PR_EMAIL_ADDRESS

Electronic mail address

PR_ADDRTYPE

Electronic mail address type

PR_OTHER_TELEPHONE_NUMBER

Alternate telephone number (other than home or office)

PR_BUSINESS_FAX_NUMBER

Business fax number

PR_HOME_FAX_NUMBER

Home fax number

PR_RADIO_TELEPHONE_NUMBER

Radio telephone number

PR_INITIALS

Initials

PR_LOCATION

Location, in the format buildingnumber/roomnumber (for example, 7/3007 represents room 3007 in building 7)

PR_CAR_TELEPHONE_NUMBER

Car telephone number

Symbols that CleanString deletes

Character Code

Description

7 (beep)

Removed unless preceded by character 13 (paragraph), then converted to character 9 (tab).

10 (line feed)

Converted to character 13 (paragraph) unless preceded by character 13, then removed.

13 (paragraph)

Unchanged.

31 (optional hyphen)

Removed.

160 (nonbreaking space)

Converted to character 32 (space).

172 (optional hyphen)

Removed.

176 (nonbreaking space)

Converted to character 32 (space).

182 (paragraph mark)

Removed.

183 (bullet)

Converted to character 32 (space).

Enumeration WdKey

Constant

Value

Constant

Value

wdKey0

48

wdKeyInsert

45

wdKey1

49

wdKeyJ

74

wdKey2

50

wdKeyK

75

wdKey3

51

wdKeyL

76

wdKey4

52

wdKeyM

77

wdKey5

53

wdKeyN

78

wdKey6

54

wdKeyNumeric0

96

wdKey7

55

wdKeyNumeric1

97

wdKey8

56

wdKeyNumeric2

98

wdKey9

57

wdKeyNumeric3

99

wdKeyA

65

wdKeyNumeric4

100

wdKeyAlt

1024

wdKeyNumeric5

101

wdKeyB

66

wdKeyNumeric5Special

12

wdKeyBackSingleQuote

192

wdKeyNumeric6

102

wdKeyBackSlash

220

wdKeyNumeric7

103

wdKeyBackspace

8

wdKeyNumeric8

104

wdKeyC

67

wdKeyNumeric9

105

wdKeyCloseSquareBrace

221

wdKeyNumericAdd

107

wdKeyComma

188

wdKeyNumericDecimal

110

wdKeyCommand

512

wdKeyNumericDivide

111

wdKeyControl

512

wdKeyNumericMultiply

106

wdKeyD

68

wdKeyNumericSubtract

109

wdKeyDelete

46

wdKeyO

79

wdKeyE

69

wdKeyOpenSquareBrace

219

wdKeyEnd

35

wdKeyOption

1024

wdKeyEquals

187

wdKeyP

80

wdKeyEsc

27

wdKeyPageDown

34

wdKeyF

70

wdKeyPageUp

33

wdKeyF1

112

wdKeyPause

19

wdKeyF10

121

wdKeyPeriod

190

wdKeyF11

122

wdKeyQ

81

wdKeyF12

123

wdKeyR

82

wdKeyF13

124

wdKeyReturn

13

wdKeyF14

125

wdKeyS

83

wdKeyF15

126

wdKeyScrollLock

145

wdKeyF16

127

wdKeySemiColon

186

wdKeyF2

113

wdKeyShift

256

wdKeyF3

114

wdKeySingleQuote

222

wdKeyF4

115

wdKeySlash

191

wdKeyF5

116

wdKeySpacebar

32

wdKeyF6

117

wdKeyT

84

wdKeyF7

118

wdKeyTab

9

wdKeyF8

119

wdKeyU

85

wdKeyF9

120

wdKeyV

86

wdKeyG

71

wdKeyW

87

wdKeyH

72

wdKeyX

88

wdKeyHome

36

wdKeyY

89

wdKeyHyphen

189

wdKeyZ

90

wdKeyI

73

wdNoKey

255

File converter class name

Word format

File converter class name

Word Document

""

Document Template

"Dot"

Text Only

"Text"

Text Only with Line Breaks

"CRText"

MS-DOS Text

"8Text"

MS-DOS Text with Line Breaks

"8CRText"

Rich Text Format

"Rtf"

Unicode Text

"Unicode"

Enumeration WdAlertLevel

Constant

Value

Description

wdAlertsAll

-1

All message boxes and alerts are displayed; errors are returned to the macro.

wdAlertsMessageBox

-2

Only message boxes are displayed; errors are trapped and returned to the macro.

wdAlertsNone

0

No alerts or message boxes are displayed. If a macro encounters a message box, the default value is chosen and the macro continues.

Enumeration WdWordDialog

Constant

Value

Constant

Value

wdDialogConnect

420

wdDialogMailMergeCreateHeaderSource

643

wdDialogConsistencyChecker

1121

wdDialogMailMergeFieldMapping

1304

wdDialogControlRun

235

wdDialogMailMergeFindRecipient

1326

wdDialogConvertObject

392

wdDialogMailMergeFindRecord

569

wdDialogCopyFile

300

wdDialogMailMergeHelper

680

wdDialogCreateAutoText

872

wdDialogMailMergeInsertAddressBlock

1305

wdDialogCSSLinks

1261

wdDialogMailMergeInsertAsk

4047

wdDialogDocumentStatistics

78

wdDialogMailMergeInsertFields

1307

wdDialogDrawAlign

634

wdDialogMailMergeInsertFillIn

4048

wdDialogDrawingGrid

1168

wdDialogMailMergeInsertGreetingLine

1306

wdDialogDrawSnapToGrid

633

wdDialogMailMergeInsertIf

4049

wdDialogEditAutoText

985

wdDialogMailMergeInsertNextIf

4053

wdDialogEditCreatePublisher

732

wdDialogMailMergeInsertSet

4054

wdDialogEditFind

112

wdDialogMailMergeInsertSkipIf

4055

wdDialogEditFrame

458

wdDialogMailMergeOpenDataSource

81

wdDialogEditGoTo

896

wdDialogMailMergeOpenHeaderSource

82

wdDialogEditGoToOld

811

wdDialogMailMergeQueryOptions

681

wdDialogEditLinks

124

wdDialogMailMergeRecipients

1308

wdDialogEditObject

125

wdDialogMailMergeSetDocumentType

1339

wdDialogEditPasteSpecial

111

wdDialogMailMergeUseAddressBook

779

wdDialogEditPublishOptions

735

wdDialogMarkCitation

463

wdDialogEditReplace

117

wdDialogMarkIndexEntry

169

wdDialogEditStyle

120

wdDialogMarkTableOfContentsEntry

442

wdDialogEditSubscribeOptions

736

wdDialogMyPermission

1437

wdDialogEditSubscribeTo

733

wdDialogNewToolbar

586

wdDialogEditTOACategory

625

wdDialogNoteOptions

373

wdDialogEmailOptions

863

wdDialogOrganizer

222

wdDialogFileDocumentLayout

178

wdDialogPermission

1469

wdDialogFileFind

99

wdDialogPhoneticGuide

986

wdDialogFileMacCustomPageSetupGX

737

wdDialogReviewAfmtRevisions

570

wdDialogFileMacPageSetup

685

wdDialogSchemaLibrary

1417

wdDialogFileMacPageSetupGX

444

wdDialogSearch

1363

wdDialogFileNew

79

wdDialogShowRepairs

1381

wdDialogFileOpen

80

wdDialogTableAutoFormat

563

wdDialogFilePageSetup

178

wdDialogTableCellOptions

1081

wdDialogFilePrint

88

wdDialogTableColumnWidth

143

wdDialogFilePrintOneCopy

445

wdDialogTableDeleteCells

133

wdDialogFilePrintSetup

97

wdDialogTableFormatCell

612

wdDialogFileRoutingSlip

624

wdDialogTableFormula

348

wdDialogFileSaveAs

84

wdDialogTableInsertCells

130

wdDialogFileSaveVersion

1007

wdDialogTableInsertRow

131

wdDialogFileSummaryInfo

86

wdDialogTableInsertTable

129

wdDialogFileVersions

945

wdDialogTableOfCaptionsOptions

551

wdDialogFitText

983

wdDialogTableOfContentsOptions

470

wdDialogFontSubstitution

581

wdDialogTableProperties

861

wdDialogFormatAddrFonts

103

wdDialogTableRowHeight

142

wdDialogFormatBordersAndShading

189

wdDialogTableSort

199

wdDialogFormatBulletsAndNumbering

824

wdDialogTableSplitCells

137

wdDialogFormatCallout

610

wdDialogTableTableOptions

1080

wdDialogFormatChangeCase

322

wdDialogTableToText

128

wdDialogFormatColumns

177

wdDialogTableWrapping

854

wdDialogFormatDefineStyleBorders

185

wdDialogTCSCTranslator

1156

wdDialogFormatDefineStyleFont

181

wdDialogTextToTable

127

wdDialogFormatDefineStyleFrame

184

wdDialogToolsAcceptRejectChanges

506

wdDialogFormatDefineStyleLang

186

wdDialogToolsAdvancedSettings

206

wdDialogFormatDefineStylePara

182

wdDialogToolsAutoCorrect

378

wdDialogFormatDefineStyleTabs

183

wdDialogToolsAutoCorrectExceptions

762

wdDialogFormatDrawingObject

960

wdDialogToolsAutoManager

915

wdDialogFormatDropCap

488

wdDialogToolsAutoSummarize

874

wdDialogFormatEncloseCharacters

1162

wdDialogToolsBulletsNumbers

196

wdDialogFormatFont

174

wdDialogToolsCompareDocuments

198

wdDialogFormatFrame

190

wdDialogToolsCreateDirectory

833

wdDialogFormatPageNumber

298

wdDialogToolsCreateEnvelope

173

wdDialogFormatParagraph

175

wdDialogToolsCreateLabels

489

wdDialogFormatPicture

187

wdDialogToolsCustomize

152

wdDialogFormatRetAddrFonts

221

wdDialogToolsCustomizeKeyboard

432

wdDialogFormatSectionLayout

176

wdDialogToolsCustomizeMenuBar

615

wdDialogFormatStyle

180

wdDialogToolsCustomizeMenus

433

wdDialogFormatStyleGallery

505

wdDialogToolsDictionary

989

wdDialogFormatStylesCustom

1248

wdDialogToolsEnvelopesAndLabels

607

wdDialogFormatTabs

179

wdDialogToolsGrammarSettings

885

wdDialogFormatTheme

855

wdDialogToolsHangulHanjaConversion

784

wdDialogFormattingRestrictions

1427

wdDialogToolsHighlightChanges

197

wdDialogFormFieldHelp

361

wdDialogToolsHyphenation

195

wdDialogFormFieldOptions

353

wdDialogToolsLanguage

188

wdDialogFrameSetProperties

1074

wdDialogToolsMacro

215

wdDialogHelpAbout

9

wdDialogToolsMacroRecord

214

wdDialogHelpWordPerfectHelp

10

wdDialogToolsManageFields

631

wdDialogHelpWordPerfectHelpOptions

511

wdDialogToolsMergeDocuments

435

wdDialogHorizontalInVertical

1160

wdDialogToolsOptions

974

wdDialogIMESetDefault

1094

wdDialogToolsOptionsAutoFormat

959

wdDialogInsertAddCaption

402

wdDialogToolsOptionsAutoFormatAsYouType

778

wdDialogInsertAutoCaption

359

wdDialogToolsOptionsBidi

1029

wdDialogInsertBookmark

168

wdDialogToolsOptionsCompatibility

525

wdDialogInsertBreak

159

wdDialogToolsOptionsEdit

224

wdDialogInsertCaption

357

wdDialogToolsOptionsEditCopyPaste

1356

wdDialogInsertCaptionNumbering

358

wdDialogToolsOptionsFileLocations

225

wdDialogInsertCrossReference

367

wdDialogToolsOptionsFuzzy

790

wdDialogInsertDatabase

341

wdDialogToolsOptionsGeneral

203

wdDialogInsertDateTime

165

wdDialogToolsOptionsPrint

208

wdDialogInsertField

166

wdDialogToolsOptionsSave

209

wdDialogInsertFile

164

wdDialogToolsOptionsSecurity

1361

wdDialogInsertFootnote

370

wdDialogToolsOptionsSmartTag

1395

wdDialogInsertFormField

483

wdDialogToolsOptionsSpellingAndGrammar

211

wdDialogInsertHyperlink

925

wdDialogToolsOptionsTrackChanges

386

wdDialogInsertIndex

170

wdDialogToolsOptionsTypography

739

wdDialogInsertIndexAndTables

473

wdDialogToolsOptionsUserInfo

213

wdDialogInsertMergeField

167

wdDialogToolsOptionsView

204

wdDialogInsertNumber

812

wdDialogToolsProtectDocument

503

wdDialogInsertObject

172

wdDialogToolsProtectSection

578

wdDialogInsertPageNumbers

294

wdDialogToolsRevisions

197

wdDialogInsertPicture

163

wdDialogToolsSpellingAndGrammar

828

wdDialogInsertSubdocument

583

wdDialogToolsTemplates

87

wdDialogInsertSymbol

162

wdDialogToolsThesaurus

194

wdDialogInsertTableOfAuthorities

471

wdDialogToolsUnprotectDocument

521

wdDialogInsertTableOfContents

171

wdDialogToolsWordCount

228

wdDialogInsertTableOfFigures

472

wdDialogTwoLinesInOne

1161

wdDialogInsertWebComponent

1324

wdDialogUpdateTOC

331

wdDialogLetterWizard

821

wdDialogViewZoom

577

wdDialogListCommands

723

wdDialogWebOptions

898

wdDialogMailMerge

676

wdDialogWindowActivate

220

wdDialogMailMergeCheck

677

wdDialogXMLElementAttributes

1460

wdDialogMailMergeCreateDataSource

642

wdDialogXMLOptions

1425

Enumeration WdEnableCancelKey

Constant

Value

Description

wdCancelDisabled

0

Prevents CTRL+BREAK from interrupting a macro.

wdCancelInterrupt

1

Allows a macro to be interrupted by CTRL+BREAK.

Enumeration WdInternationalIndex

Constant

Value

Description

wd24HourClock

21

Returns True if you're using 24-hour time; returns False if you're using 12-hour time.

wdCurrencyCode

20

Returns the currency symbol ($ in U.S. English).

wdDateSeparator

25

Returns the date separator (/ in U.S. English).

wdDecimalSeparator

18

Returns the decimal separator (. in U.S. English).

wdInternationalAM

22

Returns the string used to indicate morning hours (for example, 10 AM).

wdInternationalPM

23

Returns the string used to indicate afternoon and evening hours (for example, 2 PM).

wdListSeparator

17

Returns the list separator (, in U.S. English).

wdProductLanguageID

26

Returns the language version of Word.

wdThousandsSeparator

19

Returns the thousands separator (, in U.S. English).

wdTimeSeparator

24

Returns the time separator (: in U.S. English).

Enumeration WdKeyCategory

Constant

Value

wdKeyCategoryAutoText

4

wdKeyCategoryCommand

1

wdKeyCategoryDisable

0

wdKeyCategoryFont

3

wdKeyCategoryMacro

2

wdKeyCategoryNil

-1

wdKeyCategoryPrefix

7

wdKeyCategoryStyle

5

wdKeyCategorySymbol

6

Enumeration WdMailSystem

Constant

Value

wdMAPI

1

wdMAPIandPowerTalk

3

wdNoMailSystem

0

wdPowerTalk

2

Enumeration WdWindowState

Constant

Value

wdWindowStateMaximize

1

wdWindowStateMinimize

2

wdWindowStateNormal

0

Enumeration WdDocumentMedium

Constant

Value

wdDocument

1

wdEmailMessage

0

wdWebPage

2

Enumeration WdSpellingWordType

Constant

Value

wdAnagram

2

wdSpellword

0

wdWildcard

1

Enumeration WdHelpType

Constant

Value

Description

wdHelp

0

Displays the Help Topics dialog box.

wdHelpAbout

1

Displays the About Microsoft Word dialog box (Help menu).

wdHelpActiveWindow

2

Displays Help describing the command associated with the active view or pane.

wdHelpContents

3

Displays the Help Topics dialog box.

wdHelpExamplesAndDemos

4

n/a ???

wdHelpHWP

13

Displays Help topics for AreA Hangul users.

wdHelpIchitaro

11

Displays Help topics for Ichitaro users.

wdHelpIndex

5

Displays the Help Topics dialog box.

wdHelpKeyboard

6

n/a ???

wdHelpPE2

12

Displays Help topics for IBM Personal Editor 2 users.

wdHelpPSSHelp

7

Displays product support information.

wdHelpQuickPreview

8

n/a ???

wdHelpSearch

9

Displays the Help Topics dialog box.

wdHelpUsingHelp

10

Displays a list of Help topics that describe how to use Help.

Enumeration WdOrganizerObject

Constant

Value

wdOrganizerObjectAutoText

1

wdOrganizerObjectCommandBars

2

wdOrganizerObjectProjectItems

3

wdOrganizerObjectStyles

0

Enumeration WdPrintOutRange

Constant

Value

wdPrintAllDocument

0

wdPrintCurrentPage

2

wdPrintFromTo

3

wdPrintRangeOfPages

4

wdPrintSelection

1

Enumeration WdPrintOutItem

Constant

Value

wdPrintAutoTextEntries

4

wdPrintComments

2

wdPrintDocumentContent

0

wdPrintDocumentWithMarkup

7

wdPrintEnvelope

6

wdPrintKeyAssignments

5

wdPrintMarkup

2

wdPrintProperties

1

wdPrintStyles

3

Enumeration WdPrintOutPages

Constant

Value

wdPrintAllPages

0

wdPrintEvenPagesOnly

2

wdPrintOddPagesOnly

1

Enumeration WdSaveOptions

Constant

Value

wdDoNotSaveChanges

0

wdPromptToSaveChanges

-2

wdSaveChanges

-1

Enumeration WdOriginalFormat

Constant

Value

wdOriginalDocumentFormat

1

wdPromptUser

2

wdWordDocument

0

Enumeration WdXMLSelectionChange

Constant

Value

Description

wdXMLSelectionChangeReasonDelete

2

Selection has been deleted.

wdXMLSelectionChangeReasonInsert

1

Text has been inserted into the selection.

wdXMLSelectionChangeReasonMove

0

Insertion point has been moved.

 

MSO Enumerations

Enumeration msoAutomationSecurity

Constant

Value

Description

msoAutomationSecurityByUI

2

Uses the security setting specified in the Security dialog box.

msoAutomationSecurity ForceDisable

3

Disables all macros in all files opened programmatically without showing any security alerts.

msoAutomationSecurityLow

1

Enables all macros. This is the default value of the property.

Enumeration MsoFeatureInstall

Constant

Value

Description

msoFeatureInstallNone

0

The default value. A generic Automation error is generated at run time when uninstalled features are called.

msoFeatureInstallOnDemand

1

The user is prompted to install new features.

msoFeatureInstallOnDemandWithUI

2

A progress meter is displayed during installation. The user isn't prompted to install new features.

Enumeration MsoFileDialogType

Constant

Value

Description

msoFileDialogFilePicker

3

File picker

msoFileDialogFolderPicker

4

Folder picker

msoFileDialogOpen

1

OpenFile dialog

msoFileDialogSaveAs

2

SaveAs dialog

Enumeration MsoSyncEventType

Constant

Value

msoSyncEventDownloadFailed

2

msoSyncEventDownloadInitiated

0

msoSyncEventDownloadNoChange

6

msoSyncEventDownloadSucceeded

1

msoSyncEventOffline

7

msoSyncEventUploadFailed

5

msoSyncEventUploadInitiated

3

msoSyncEventUploadSucceeded

4

 


Etudes for Microsoft Word Programmers. Appendix. Object Application.


Unless otherwise noted, all materials on this site are
© 2000-2009 Evgeny Akhundzhanov, All Rights Reserved Worldwide
Microsoft is in no way affiliated with, nor offers endorsement of, this site.
www.transcriber.ru | E-mail the Author