selection of table

E

elle0612

Hi

I want to be able to do a particular thing "if a table selection exists".

If it does not exist I want a little message box to appear saying "select
the table first".

What is the vba code for this?

Thanks
 
J

Jay Freedman

elle0612 said:
Hi

I want to be able to do a particular thing "if a table selection
exists".

If it does not exist I want a little message box to appear saying
"select the table first".

What is the vba code for this?

Thanks

If Selection.Information(wdWithInTable) Then
' do something
Else
MsgBox "Please select a table."
End If

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
E

elle0612

Thank you, its just what I needed.

Jay Freedman said:
If Selection.Information(wdWithInTable) Then
' do something
Else
MsgBox "Please select a table."
End If

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top