![]() |
|
#1
|
|||
|
|||
|
I have many content control boxes in my form. Can a macro help in ensuring all the content control boxes are completed before the user save the file? |
|
#2
|
||||
|
||||
|
For example:
Code:
Private Sub AutoClose()
Dim CCtrl As ContentControl, Cancel As Boolean: Cancel = False
With ActiveDocument
For Each CCtrl In .ContentControls
If CCtrl.ShowingPlaceholderText = True Then Cancel = True: CCtrl.Range.Select: Exit For
Next
If Cancel = True Then
MsgBox "Please complete all the items"
.Saved = False
SendKeys "{ESC}"
End If
End With
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#3
|
||||
|
||||
|
Cross-posted at: Macro for saving a macro enabled file to a non macro file
For cross-posting etiquette, please read: Excelguru Help Site - A message to forum cross posters
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#4
|
|||
|
|||
|
Ops i didnt know is the same forum.
Anyway thanks a lot, it helps |
|
#5
|
||||
|
||||
|
The whole point is that they are NOT the same forum...
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Change Value of a Content Control based on the value of another content Control
|
jsc_msoffice | Word VBA | 2 | 05-21-2021 09:51 PM |
Content Control Dropdowns - How to duplicate the content control and allow a second choice
|
ashleyf | Word VBA | 2 | 03-19-2020 09:11 AM |
| Content Control content deleted when re-uploading to SharePoint | Peterson | Word | 5 | 06-27-2018 08:13 PM |
Clicking the selected Content Control checkbox returns wrong control in vba event
|
DougsGraphics | Word VBA | 2 | 06-24-2015 07:31 AM |
Deleting a table from a content control -- preserving the content control
|
BrainSlugs83 | Word Tables | 8 | 11-14-2013 03:06 AM |