View Single Post
 
Old 04-18-2016, 02:16 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

In that case you could use code like:
Code:
Private Sub Document_Close()
Dim Rslt As Long
    Select Case ActiveDocument.FormFields("drop").Result
    Case "Internal"
    If ActiveDocument.FormFields("mob_ph_check").CheckBox.Value = False And ActiveDocument.FormFields("broad_check").CheckBox.Value = False And ActiveDocument.FormFields("car_check").CheckBox.Value = False And ActiveDocument.FormFields("vsp_check").CheckBox.Value = False Then
        Rslt = MsgBox("Are you sure that contract should be without benefits?", vbYesNoCancel)
        Select Case Rslt
            Case vbYes
            Case vbNo
            Case vbCancel
       End Select
    End If
    Case "Permanent"
    If ActiveDocument.FormFields("mob_ph_check").CheckBox.Value = False And ActiveDocument.FormFields("broad_check").CheckBox.Value = False And ActiveDocument.FormFields("car_check").CheckBox.Value = False And ActiveDocument.FormFields("vsp_check").CheckBox.Value = False Then
        Rslt = MsgBox("Are you sure?", vbYesNoCancel)
        Select Case Rslt
            Case vbYes
            Case vbNo
            Case vbCancel
       End Select
    End If
  End Select
End Sub
Simply flesh out the Case statements with whatever you want to have happen when the user presses Yes, No or Cancel.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote