View Single Post
 
Old 04-16-2015, 01:55 AM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

En supposant que ce sont des champs de formulaire existants et les tables sont dans le corps du document et non dans des boîtes de texte:
Code:
Sub Example()
Dim bProtected As Boolean
    If Not ActiveDocument.ProtectionType = wdNoProtection Then
        bProtected = True
        ActiveDocument.Unprotect Password:=""
    End If
    If ActiveDocument.FormFields("CheckBox211").CheckBox.Value = True Then
        ActiveDocument.Tables(2).Rows(2).Range.Font.Hidden = False
    Else
        ActiveDocument.Tables(2).Rows(2).Range.Font.Hidden = True
    End If
    If bProtected = True Then
        ActiveDocument.Protect _
                Type:=wdAllowOnlyFormFields, _
                NoReset:=True, _
                Password:=""
    End If
lbl_Exit:
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote