English 中文(简体)
语言之类
原标题:Option buttons used in Word VBA
  • 时间:2024-01-14 17:43:56
  •  标签:
  • vba
  • ms-word

我还有一个问题,我可以解决。 此时此刻,它指的是选择纽州。

I have one group of two buttons (YES and NO) and I have three more groups of one button each. The idea is, if it is NO button "on", then all tree groups should have property "Enabled" value "false". Basically, they should be blocked. If it is YES button "on", then all tree groups should have property "Enabled" value "true". All tree groups should be "on" or "off" depending on whether I click on them and how many times. Those three buttons are independent and can be in combinations with each other "on" or "off".

1

“2”/

i 根据《刑法》审判:

Private Sub V1028_Click()
    Dim E As Shape
        If ActiveDocument.Shapes(91) = True Then
            Set E = ActiveDocument.Shapes(96)
            E.Visible = True
            Set E = ActiveDocument.Shapes(97)
            E.Visible = True
            Set E = ActiveDocument.Shapes(98)
            E.Visible = True
        End If
End Sub

我得到的信息是“目标不支持这种财产或方法”!

Can someone help me? Thanks in advance!

问题回答
  • Use a CheckBox instead of an OptionButton achieve the following:

所有这三组人都应是“被点击”或“被击”的,取决于我是否点击他们,以及有多少次

  • Assumes the first OptionButton control is named OptionButton1
Option Explicit
  OptionButton1 change event code
Private Sub OptionButton1_Change()
    Dim ctl As InlineShape
    Dim i As Long, ctlName As Long, opVal As Boolean
    Const CTL_TYPE = "CheckBox"
    For Each ctl In ActiveDocument.InlineShapes
        With ctl.OLEFormat.Object
            If .Name = "OptionButton1" Then
                opVal = .Value
                Exit For
            End If
        End With
    Next
    For Each ctl In ActiveDocument.InlineShapes
        With ctl.OLEFormat
            If ctl.Type = wdInlineShapeOLEControlObject Then
                If TypeName(.Object) = CTL_TYPE Then
                    .Object.Object.Enabled = opVal
                End If
            End If
        End With
    Next
End Sub

Microsoft documentation:

的主动X表格

enter image description here





相关问题
Handling no results for docmd.applyfilter

I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...

Outlook 2007 CommandBarControl.Execute won t work

I recently switched to Outlook 2007 and noticed that my VBA-macros won t work. I use the following code to open a new appointment-item (and fill it automatically). It worked perfect in Outlook 2003, ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

MS Access: list macro from VBA

I have to deal with a few macros (not VBA) in an inherited Access application. In order to document them, I would like to print or list the actions in those macros, but I am very dissatisfied by ...

热门标签