How to clear contents of a Word document prgrammatically

I would like to clear the contents of a the active document via macro function. I cannot find a command such as "activedocument.clear" or something like this. What is available for me?
englmAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
rbrConnect With a Mentor Commented:
Use

Selection.WholeStory
Selection.Cut
0
 
bigelosCommented:
Try this macro (assuming you have the active document selected).

Sub MAIN
EditSelectAll
EditClear
End Sub

0
 
englmAuthor Commented:
The 'editselectall' function does not work when I use it in a subroutine. I selected my text using the activedoc.range parameters. I cannot find any references to 'editselectall' or 'editclear' in the docummentation.

Also, I don't have to necessarily run this form a macro. It can be executed from a subroutine on a userform if this makes a difference.
0
 
bigelosCommented:
What version of Word are you using?  
EditSelectAll and EditClear are both WordBasic commands in Word 7.0.


0
All Courses

From novice to tech pro — start learning today.