Hi Keith,
Hope this helps.
Beth
(1) Differences Between Word VBA for Windows and Word VBA for the Macintosh
Differences between Word VBA for Windows and Word VBA for the Macintosh
Microsoft Word VBA for the Macintosh differs from Microsoft Word VBA for
Windows in the following areas:
€ In Windows, ActiveX controls can be placed on any Word document or
UserForm. On the Macintosh, ActiveX controls are not supported, and only
controls provided in the toolbox in the Visual Basic Editor can be placed on
UserForms. The Additional Controls command (Tools menu and Toolbox shortcut
menu) is not available in the Visual Basic Editor on the Macintosh.
€ On the Macintosh, the MailMessage object and its associated methods and
properties are not available.
(2) Strategies for Developing Cross-Platform Solutions
Strategies for Developing Cross-Platform Solutions
Use Built-in Properties for Paths
In applications whose object models support built-in properties, use these
properties to return a file or folder name. For example:
€ In Word, Excel, and PowerPoint, use the Path property of the Application
object to return the path to the application.
€ In Word and Excel, use the PathSeparator property of the Application
object rather than a backslash or colon to separate folder names in a path.
€ In Word, use the DefaultFilePath property of the Options object to return
a folder, such as the Templates folderThe paths returned by these properties
will contain the appropriate path separators and drive names. To determine
whether the application you're working with includes such properties, check
the application's object model documentation.
Use Conditional Compilation
For platform differences that you cannot resolve by using the built-in
properties of an application's object model, use conditional compilation.
This is necessary when code produces a compile error on one platform but
runs on the other. With conditional compilation, you can control what code
is compiled.
For example, if you want to write a file search function that runs on either
platform, you can create a conditional compiler constant and set it to
indicate whether code is compiled for Windows or the Macintosh. To indicate
that code is compiled for the Macintosh, click Project Properties on the
Tools menu in the Visual Basic Editor, and then type Mac = 1 in the
Conditional Compilation Arguments box. The following code would then compile
and run on the Macintosh. In Windows, you would set the same constant to 0
(zero) to compile and run the code in Windows.
#If Mac Then
Dim ffFind As FileFind
Set ffFind = Application.FileFind
With ffFind
.Options = msoOptionsNew
.Name = "New"
.SearchPath = "Macintosh HD:Users:Shared"
.Execute
For i = 0 To .FoundFiles.Count - 1
MsgBox .FoundFiles(i)
Next i
End With
#Else
Dim fsSearch As FileSearch
Set fsSearch = Application.FileSearch
With fsSearch
.FileName = "*New*"
.LookIn = "C:\My Documents"
.Execute
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
Next i
End With
#End If
Error Messages
The following messages are specific to Visual Basic for Windows:
€ ActiveX component not found (Error 337).
€ ActiveX Component did not run correctly (Error 338).
€ Specified ActiveX Component was not found (Error 363).
€ ActiveX component not correctly registered (Error 336).
€ The file specified is out of date. This program requires a later version
(Error 368).
Note When you share forms between a Windows-based computer and the
Macintosh, you may receive a run-time error message when you open a form
that contains a control with a picture on it. To avoid this problem when you
are sharing forms between a Windows-based computer and the Macintosh, use
Windows Bitmap (BMP) graphics only on form controls.