Share via

Implementing the Speech function on a MAC and Windows PCs

Anonymous
2017-05-06T09:13:47+00:00

Hi.

I have a Windows PC and am writing a PowerPoint 2010 presentation.  In several places I access the SAPI speech capabilities of the Windows PC.

I've never owned a MAC computer and from what I see on the internet, MAC's have a different kind of voice system.

I would like for the presentation to run on both Windows PCs and MACs.

Two questions:

  1. Will Windows Office/PowerPoint 2010 VBA code run on a MAC that has Microsoft Office/PP installed on it?
  2. Is there a way to test a machine and see if it is a MAC and then implement the MAC speech capabilities, as I do with Windows?

Here's what I think the VBA code would look like, and need help with the MAC part of the code:

Sub Speakit(Phrase As String)

If MAC Then   'A test that will check if this is a MAC computer

    ' Initiate the speech capabilities of the MAC computer here

Else  'If not a MAC computer then it's likely a Windows PC

    Dim SAPIObj As Object

    Set SAPIObj = CreateObject("SAPI.SPvoice")

    SAPIObj.Rate = -2

    SAPIObj.speak "<pitch middle='-3'>" & Phrase

End If

End Sub

Thanks for any help.

Don

Microsoft 365 and Office | PowerPoint | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2017-05-11T02:02:28+00:00

Hi Don,

Yes, Office 2008 for Mac it the only version that does not support VBA.

You can use most of the same objects that are available in VBA for Office, but I do not have any links for examples; I also suggest testing the code directly on a Mac if possible, if there are any issues, you can post a new thread here and we can help you troubleshoot it.

You can find more information regarding VBA on Office for Mac in this MSDN article:

VBA for Office for Mac.

Regards,

Sheen

Was this answer helpful?

0 comments No comments

12 additional answers

Sort by: Most helpful
  1. Anonymous
    2017-05-06T15:03:45+00:00

    John, would you be able to give me some direction as to where I could go on the Internet to find someone with MAC programming experience who could give me some help with my situation? Like maybe a reputable MAC forum?

    Don

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2017-05-06T14:49:58+00:00

    Yes that's pretty much it.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2017-05-06T14:43:52+00:00

    Would I then insert my Windows speech VBA code in between the #Else and #End If lines?

    Or is the conditional only for testing for a MAC and not intended to be used to run VBA code?

    Thanks.

    Don

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2017-05-06T13:05:57+00:00

    You can check for a Mac like this

    #If Mac Then

    MsgBox "It's a mac"

    #Else

    MsgBox "PC"

    #End If

    There is Text to speech in Accessibility settings but I think you would have to run it from Apple Script (I'm not an expert at this!)

    Was this answer helpful?

    0 comments No comments