Statements and Functions with Version-Specific Behavior

The following statments and functions exhibit different behavior depending on the version of Word in which they are run.

Statement or function

Version-specific behavior

AppInfo$()

The strings returned by the values 9 and 10 are meaningful only in Word version 6.0 for Windows running in Windows 3.x and Word version 6.0 for the Macintosh.

The value 26 is valid in Word version 7.0 only.

Beep

In the Windows versions of Word, the sound produced by Beep is determined by the ErrorType argument; in Word version 6.0 for the Macintosh, Beep always produces the sound selected in the Sound control panel.


Statement or function

Version-specific behavior

DDEExecute

In Word version 6.0 for the Macintosh, you cannot use DDEExecute to send keystrokes to another application.

Declare

In Word version 6.0 for Windows, you can only declare external functions in 16-bit libraries.

In Word version 6.0 for the Macintosh, you can only declare external functions in Word add-in libraries (WLLs).

In Word version 6.0 for Windows NT and Word version 7.0, you can only declare external functions in 32-bit libraries. In addition, external function names are case-sensitive.

For detailed information about using Declare in all versions of Word, see "Calling Routines in DLLs" in Chapter 9, "More WordBasic Techniques" (Part 1, "Learning WordBasic").

DlgSetPicture

In Word version 6.0 for the Macintosh, PictureName$ accepts a value to indicate a PICT file stored in the resource fork of the template containing the macro.

DOSToWin$(), WinToDos$()

In Word version 6.0 for the Macintosh, these statements perform no translation and return the original string unchanged.

FileFind

In Word version 6.0 for the Macintosh, you use the . ShowFolders argument to group filenames by folder.

In Word version 7.0, you cannot specify multiple folders with .SearchPath, and you cannot display the Find File dialog box using a Dialog or Dialog() instruction.

FileNameInfo$()

In Word version 6.0 for the Macintosh, FileNameInfo$(3) and FileNameInfo$(4) return the same value (since Macintosh filenames do not have "extensions").

In Word version 6.0 for the Macintosh, FileNameInfo$(6) returns a string that begins with the zone and computer name where the specified file is stored.


Statement or function

Version-specific behavior

FileOpen

In Word version 6.0 for the Macintosh, you can use this statement to open only one file at a time.

In Word version 6.0 for the Macintosh, if you open a document with FileOpen, the case of the document window's title will match the case of text specified by the .Name argument. For example, the instruction FileOpen .Name = "my file" opens a document called "My File" in a document window with the title "my file."

Files$()

In the Windows versions of Word, the question mark (?) and asterisk (*) wildcards are accepted as file specifiers. On the Macintosh, wildcards are not accepted; MacID$() is used instead.

GetAttr()

In Word version 6.0 for the Macintosh, the System and Archive attributes are not supported.

GetPrivateProfileString$()

In Word version 6.0 for Windows and Word version 6.0 for the Macintosh, the arguments specify sections and key names in a particular settings file. In Word version 6.0 for Windows NT and Word version 7.0, the arguments can specify keys and values in the registry.

GetSystemInfo, GetSystemInfo$()

In the Windows versions of Word, Type is a value from 21 to 32, and the size of the array filled by GetSystemInfo is 12 elements. In Word version 6.0 for the Macintosh, Type is a value from 512 to 523, and the size of the array is 15 elements.

The strings returned by the values 23, 25 and 27 are meaningful only in Word version 6.0 for Windows running in Windows 3.x.

HelpExamplesAndDemos, HelpQuickPreview

In Word version 6.0 for Windows NT and Word version 7.0, the examples, demonstrations, and previews are not available and these statements generate errors.

InputBox$()

In the Windows versions of Word, if the user presses enter in an input box, InputBox$() returns Chr$(11)+Chr$(10); in Word version 6.0 for the Macintosh, Chr$(13) is returned.

InsertSound

In the Windows versions of Word, starts Sound Recorder; in Word version 6.0 for the Macintosh, starts Microsoft Voice Annotation.

Kill

In the Windows versions of Word, the question mark (?) and asterisk (*) wildcards are accepted. On the Macintosh, wildcards are not accepted; MacID$() is used instead.


Statement or function

Version-specific behavior

ListCommands

This statement is not valid in Word version 6.0 for Windows.

MailMergeCreateDataSource; MailMergeDataSource$(); MailMergeEditDataSource; MailMergeOpenDataSource; MailMergeQueryOptions

ODBC functionality is not supported in Word version 6.0 for the Macintosh.

MsgBox, MsgBox()

In the Windows versions of Word, a Type value of 32 produces a question symbol; in Word version 6.0 for the Macintosh, it produces an information symbol.

In Word version 6.0 for the Macintosh, a message box will not have a title bar if Title$ is an empty string ("").

Name

In the Windows versions of Word, you can use this statement to move a file to another directory; in Word version 6.0 for the Macintosh, Name does not provide this capability.

Picture

In Word version 6.0 for the Macintosh, PictureName$ accepts a value to indicate a PICT file stored in the resource fork of the template containing the macro.

ScreenUpdating

In Word version 6.0 for the Macintosh, the contents of document windows are not updated when screen updating is turned off, but document frames remain visible.

SendKeys

In Word version 6.0 for the Macintosh, you can use SendKeys to send keystrokes (10 or fewer) only to Word; you cannot use SendKeys to send keystrokes to other applications. Also, you can send a key combination that includes SHIFT by using the plus sign (+), but you cannot send key combinations that include OPTION or COMMAND.

SelInfo()

The value 37 is valid in Word version 7.0 only.

SetAttr

In Word version 6.0 for the Macintosh, the System and Archive attributes are not supported.

SetPrivateProfileString

In Word version 6.0 for Windows and Word version 6.0 for the Macintosh, the arguments specify settings, sections, and key names in a particular settings file. In Word version 6.0 for Windows NT and Word version 7.0, the arguments can specify settings, keys, and values in the registry.

ShadingPattern, ShadingPattern()

In Word version 6.0 for the Macintosh, shading pattern values 35 through 61 apply shading patterns in 2.5% increments.


Statement or function

Version-specific behavior

Shell

In the Windows versions of Word, the WindowStyle argument determines how an application started by Shell is displayed; in Word version 6.0 for the Macintosh, WindowStyle determines whether or not the application is activated. In Word version 6.0 for the Macintosh, you can use MacID$() to specify an application name.

ToolsAdvancedSettings

In Word version 6.0 for Windows NT and Word version 7.0, you cannot use this statement to modify settings in the registry.

ToolsCustomizeKeyboard

The Windows CTRL key is equivalent to the Macintosh COMMAND key; the Windows ALT key is equivalent to the Macintosh OPTION key. An additional value is available to assign the Macintosh COntrol key.