我想设置一下拉就是依赖于所选择的一个前的下拉菜单词的使用VBA码。 我看了一堆的视频和一读通过的论坛,但我不能让它工作。 我使用这个词的遗留下拉菜单,并标明它们正确,然后我写下代码在VBA:
Dim xDirection As FormField
Dim xState As FormField
On Error Resume Next
Set xDirection = ActiveDocument.FormFields("ddType")
Set xState = ActiveDocument.FormFields("ddSelection")
If ((xDirection Is Nothing) Or (xState Is Nothing)) Then Exit Sub
With xState.DropDown.ListEntries
.Clear
Select Case xDirection.Result
Case "Numbers"
.Add "1"
.Add "2"
.Add "3"
.Add "4"
.Add "5"
.Add "6"
Case "Letters"
.Add "A"
.Add "B"
.Add "C"
Case "None"
.Add "Not applicable"
End Select
End With
End Sub
问题是,这种解决方案只能作有时并不一致。 这感觉可能的选择都没有更新速度不够快,我可以选择的一封信,即使只有数字应当提供(有时我是不能够选择任何所有)。
我这样做是在办公室365.
反馈意见,将高度赞赏
谢谢你提前!