View Single Post
 
Old 12-07-2014, 10:41 PM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,138
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

Apart from the >> which should not be present, it works fine

Code:
Sub AddRow()
Const strPassWord As String = "password1"
    If ActiveDocument.ProtectionType <> wdNoProtection Then
        ActiveDocument.Unprotect Password:=strPassWord
    End If
    
    ActiveDocument.Tables(1).Rows.Add
    
    'If ActiveDocument.ProtectionType = wdNoProtection Then
        ActiveDocument.Protect _
                Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=strPassWord
    'End If
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