Link to home
Start Free TrialLog in
Avatar of Andreas Hermle
Andreas HermleFlag for Germany

asked on

check by VBA if cursor resides in a table on the last page of the current document

Dear Experts:

the following snippet is taken from a macro I regulary run.

I would like to change this snippet to accommodate the following requirement.

Not only is the cursor to reside in a table, but the table is to be located on the last page of the current document.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas

If Not Selection.Information(wdWithInTable) Then
MsgBox ("The cursor does not reside in a a table!" & vbCrLf & _
"Please make sure that the cursor resides in a table!"), vbCritical, "Cursor does not reside in a table!"
Exit Sub
End If
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry. Forget to put it in a code box.
Avatar of Andreas Hermle

ASKER

Hi Graham,

very nice coding, I am impressed. Thank you very much for it. As usual works like a charm :-)

Regards, Andreasa