Hi,

I have the macro that use vba to select the whole text of the current
document consider of a lot of pages and do cut and paste to a new document
as separate pages. But the problem is if my current document is a blank
document, how do i check that it is a blank and the macro will not select
and do cut and paste as i have encountered run time error when the current
document is blank.

please advise. thanks.
regards,
ben

RE: How to check the selection is empty after cut? by Chuck

Chuck
Tue Apr 05 12:03:02 CDT 2005

A blank document has a length of 1 (the paragraph mark). So test if the
length of the document = 1:

If Len(ActiveDocument.Range) = 1 Then
'document is blank
'do nothing
Else
'work your magic
End If

"Ben" wrote:

> Hi,
>
> I have the macro that use vba to select the whole text of the current
> document consider of a lot of pages and do cut and paste to a new document
> as separate pages. But the problem is if my current document is a blank
> document, how do i check that it is a blank and the macro will not select
> and do cut and paste as i have encountered run time error when the current
> document is blank.
>
> please advise. thanks.
> regards,
> ben