Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2005

Tip: Looking for answers? Try searching our database.

How to check the selection is empty after cut?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ben - 05 Apr 2005 17:23 GMT
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
Chuck - 05 Apr 2005 18:03 GMT
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

> Hi,
>
[quoted text clipped - 8 lines]
> regards,
> ben
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.