View Single Post
 
Old 03-30-2018, 06:50 PM
eduzs eduzs is offline Windows 10 Office 2010 32bit
Expert
 
Join Date: May 2017
Posts: 262
eduzs is on a distinguished road
Default

Try this:

I don't know how to do this without "on error" but note that in the code below the "on error" works only within the "Set" (because the "On Error Goto 0") line which will not undercover other errors in the code.

Code:
Dim oTbl As Table

On Error Resume Next
Set oTbl = ActiveDocument.Tables(1)
On Error GoTo 0

If Not oTbl Is Nothing Then
    Exists = "yes"
Else
    Exists "No"
End If
__________________
Backup your original file before doing any modification.
Reply With Quote