我想根据标签不同打开不同文档,于是使用了以下代码,然而提示“Else 没有 if”请问这个要怎么处理才能完成这个呢……
If Command4.Caption = "1" Then
With wordObj.Documents.Open("c:\Users\Administrator\Desktop\1.txt")
ElseIf Command4.Caption = "2" Then
With wordObj.Documents.Open("c:\Users\Administrator\Desktop\2.txt")
ElseIf Command4.Caption = "3" Then
With wordObj.Documents.Open("c:\Users\Administrator\Desktop\3.txt")
End If
If Command4.Caption = "1" Then
With wordObj.Documents.Open("c:\Users\Administrator\Desktop\1.txt")
ElseIf Command4.Caption = "2" Then
With wordObj.Documents.Open("c:\Users\Administrator\Desktop\2.txt")
ElseIf Command4.Caption = "3" Then
With wordObj.Documents.Open("c:\Users\Administrator\Desktop\3.txt")
End If