Compatability of Macros PC <-> Mac?

K

KR

Reposting in this group, in the hopes that someone here might know the
answer (or where to point me, to a list of issues or information)
I have some code and userforms developed in PC Word97 (for compatibility
purposes back to users still using that version).

I have a Mac user who has asked for a copy of my workbook; is there a list
anywhere of what does (and does not) work across platforms for different
versions of Word VBA, so I can check to see if there is likely to be any
issues with my code on the Mac platform? I'd rather be aware and warn a
potential user of problems before they occur...

We plan on continuing to upgrade the document this year, and I'd certainly
be interested in maximizing compatibility across versions if possible- so
any pointers to comparisons and differences across the two platforms would
be greatly appreciated.

Many thanks,
Keith
 
K

KR

Excellent resource, thank you!
The page indicates two topics to look up in the Mac Word help file to get
additional details on programming across platform... unfortunately, I'm
coming at this from the PC side, and don't have access to a Mac. Are those
specific Mac help files available via the MS website, or anywhere else? I'm
not even sure where to look....

Thanks!
Keith
 
B

Beth Rosengard

Hi Keith,

I don't think there's any other way to access MacWord's Help except from a
Mac. Can you get your user who's on a Mac to look them up for you? If not,
post back here and quote the exact Help sections you need (I can't tell
exactly from the article) and if they're not too long, I'll post them here.

--
***Please always reply to the newsgroup!***

Beth Rosengard
MacOffice MVP

Mac Word FAQ: <http://word.mvps.org/Mac/WordMacHome.html>
 
J

John McGhie [MVP - Word and Word Macintosh]

Hi Keith:

Beth is correct -- anything WRITTEN FOR Word 97 which STILL WORKS in Word 97
will work in Mac Word 2004.

Anything that has since been modified in PC Word later than Word 97 is
likely to fail. Tell your user when they get the template to open it, start
the VBA Editor, and choose Compile Template from the Debug menu.

That will give you a pretty good indication. File names may be a problem:
change "\" for Application.PathSeparator and it will work on both platforms.

Your user forms will look weird (the Mac makes them up at 72 dpi, so
everything moves around) but they should still work.

Note that new development in VBA is not a good idea: Microsoft has announced
that it is going to replace it (on both platforms) soon.

Hope this helps


Reposting in this group, in the hopes that someone here might know the
answer (or where to point me, to a list of issues or information)


We plan on continuing to upgrade the document this year, and I'd certainly
be interested in maximizing compatibility across versions if possible- so
any pointers to comparisons and differences across the two platforms would
be greatly appreciated.

Many thanks,
Keith

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
 
K

KR

Beth-

Unfortunately, I don't know any Mac users (or at least, not that I know are
Mac users) to ask.

I'm grateful for your offer to post these (length dependent), or if they are
longer (and if you are willing) you are also welcome to email them to me at
keith e ruck 2 at hotmail com (address modified to avoid spam engines; the
only dot is the one right before com).

the two topics that were listed on the MVPS page as important reads in the
Mac help files were:
(1) Differences Between Word VBA for Windows and Word VBA for the Macintosh
(2) Strategies for Developing Cross-Platform Solutions

Thanks!!
Keith
 
B

Beth Rosengard

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.
 
J

John McGhie [MVP - Word and Word Macintosh]

Hi Keith:

Flip them to me at this address as zipped attached documents. I will
compile them on the Mac for you and let you know what (if anything...)
dies...

Use the password "MVPQ" in the subject to get through my spam filter.

Cheers


Beth-

Unfortunately, I don't know any Mac users (or at least, not that I know are
Mac users) to ask.

I'm grateful for your offer to post these (length dependent), or if they are
longer (and if you are willing) you are also welcome to email them to me at
keith e ruck 2 at hotmail com (address modified to avoid spam engines; the
only dot is the one right before com).

the two topics that were listed on the MVPS page as important reads in the
Mac help files were:
(1) Differences Between Word VBA for Windows and Word VBA for the Macintosh
(2) Strategies for Developing Cross-Platform Solutions

Thanks!!
Keith

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
 
K

KR

John-

Thank you for your gracious offer. I'm actually tasked with updating the
existing code over the next 6-9 months, and it is that to-be-updated code
that I'm most concerned about working on both platforms... so I don't have
anything to send you right now, but I'll keep your note and touch base when
I'm closer to being done, to see if the offer is still open.

Many, many thanks,
Keith
 
J

John McGhie [MVP - Word and Word Macintosh]

Hi Keith:

What does it take to get an email out of you?

I suggest that it would be to your advantage to send me an email. Now, not
in six months time :)

Cheers


John-

Thank you for your gracious offer. I'm actually tasked with updating the
existing code over the next 6-9 months, and it is that to-be-updated code
that I'm most concerned about working on both platforms... so I don't have
anything to send you right now, but I'll keep your note and touch base when
I'm closer to being done, to see if the offer is still open.

Many, many thanks,
Keith

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top