change value of option button (OLE object) in Microsoft Word file

Discussion in 'AppleScript' started by bnquynhnhu, Oct 1, 2008.

  1. bnquynhnhu

    bnquynhnhu New Member

    Joined:
    Oct 1, 2008
    Messages:
    2
    Hi guys,

    I would like to convert a macro from VBA to AppleScript. Unfortunately, I'm the beginner of AppleScript and I don't know how to change value of an option button in Microsoft Word.

    For example, I have an option button with 2 options (group name = question413) Yes and No. Now, I would like to open Word file, then change value of option button with group name "question413" to Yes. Below is my code in VBA.

    SetOptionButton "question413", "Yes"

    Public Sub SetOptionButton(GroupName As String, Value As String)
    Dim oShape As Word.InlineShape
    For Each oShape In ActiveDocument.InlineShapes
    If oShape.OLEFormat.ProgID = "Forms.OptionButton.1" Then
    If oShape.OLEFormat.Object.GroupName = GroupName Then
    If oShape.OLEFormat.Object.Caption = Trim(Value) Then
    oShape.OLEFormat.Object.Value = True
    Else
    oShape.OLEFormat.Object.Value = False
    End If
    End If
    End If
    Next
    End Sub

    How could I convert them to AppleScript?Any comments would be highly appreciated.

    Thanks,
     
    bnquynhnhu, Oct 1, 2008
    #1
    1. Advertisements

  2. bnquynhnhu

    bnquynhnhu New Member

    Joined:
    Oct 1, 2008
    Messages:
    2
    Help me, please. :(
     
    bnquynhnhu, Oct 2, 2008
    #2
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Newsbot
    Replies:
    0
    Views:
    1,079
    Newsbot
    Dec 20, 2007
  2. J. Fred Bear
    Replies:
    0
    Views:
    1,109
    J. Fred Bear
    Dec 3, 2008
  3. dotlyc@sympatico.ca

    What is Microsoft OLE Extension? Do I need it?

    dotlyc@sympatico.ca, Jul 25, 2003, in forum: Apps
    Replies:
    9
    Views:
    114
    dotlyc@sympatico.ca
    Jul 27, 2003
  4. Ulrich Hobelmann

    Object not key-value-coding compliant?

    Ulrich Hobelmann, Dec 3, 2006, in forum: Programmer Help
    Replies:
    8
    Views:
    422
    Ulrich Hobelmann
    Dec 5, 2006
  5. slashlos
    Replies:
    1
    Views:
    315
    slashlos
    Feb 12, 2009
  6. Steve
    Replies:
    2
    Views:
    407
    Steve
    May 10, 2009
  7. abirtz@gmail.com

    Change default order for loading object in a nib file

    abirtz@gmail.com, Jun 1, 2009, in forum: Programmer Help
    Replies:
    1
    Views:
    244
    matt neuburg
    Jun 1, 2009
  8. Robert Hathaway
    Replies:
    0
    Views:
    302
    Robert Hathaway
    Jul 29, 2003
Loading...