![]() |
|
|
|
#1
|
||||
|
||||
|
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
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#2
|
|||
|
|||
|
Hi macropod,
You turned me to good way, as always ![]() However, still don't have any idea how to 'bite' it ;-) Code:
Select Case Rslt
Case vbYes
Me.Saved = True
Case vbNo
Exit Sub
End Select
When clicked little disk to save the file, I got question and this is ok. However when I chose button 'Yes' or 'No' nothing has happened. I want to make the action if I click X to close the file I got the question - and it works. Then when I choose 'Yes' the file should be saved but when choose 'No' I want to go back to file without system question if I want save the file and then continue filling template. The same action if I click little disk to save the file. Could you help me with that also? |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Macro to keep formatted form fields after mail merge or replace text with formatted form fields | jer85 | Word VBA | 2 | 04-05-2015 10:00 PM |
Form updating Bookmarks - writes to the bookmarks multiple times
|
PeterPlys | Word VBA | 13 | 01-14-2015 06:41 AM |
How To Find Bookmarks and/or custom fields Inside Building Blocks, Office 2010
|
thpanos | Word | 3 | 02-17-2013 08:49 AM |
Form Fields - Create blank form text field with if statement?
|
LAssist2011 | Word | 5 | 12-14-2011 03:02 PM |
| autopopulating REF fields + bookmarks | valz | Word | 10 | 09-01-2011 08:18 AM |