저는 VBA에 익숙하며 익숙합니다. 여기에 내 상황과 문제가있다 :Word VBA "레이블이 정의되지 않음"북마크가 존재하는 경우 명령
1) 북마크에 연결되는 텍스트와 콤보 박스가있는 작업 userform을 만들었습니다. 2) 문제가되는 것은 북마크가 존재하지 않는다면 작동하지 않는다는 것입니다. 양식이 모든 북마크가 존재하지 않는 문서에서 실행해야합니다.) 3) 북마크가 없으면 해당 양식에 오류 메시지를 표시하고 해당 특정 문서에있는 정보 만 입력하면됩니다. 4) 여기 있습니다 코드 :
Private Sub cmdOK_Click()
Application.ScreenUpdating = False
With ActiveDocument
If .Bookmarks.Exists("cboYourName") Then
.Range.Text = cboYourName.Value
Else: GoTo 28
End If
If .Bookmarks.Exists("cboYourPhone") Then
.Range.Text = cboYourPhone.Value
Else: GoTo 32
End If
If .Bookmarks.Exists("cboYourFax") Then
.Range.Text = cboYourFax.Value
Else: GoTo 36
End If
If .Bookmarks.Exists("cboYourEmail") Then
.Range.Text = cboYourEmail.Value
Else: GoTo 40
End If
If .Bookmarks.Exists("txtContractName") Then
.Range.Text = txtContractName.Value
Else: GoTo 44
End If
If .Bookmarks.Exists("txtContractNumber") Then
.Range.Text = txtContractNumber.Value
Else: End
End If
End With
Application.ScreenUpdating = True
Unload Me
End Sub
4) 어떻게 작동합니까? ?????????