Solved

How to clear contents of a Word document prgrammatically

Posted on 1998-01-05
4
320 Views
Last Modified: 2012-06-27
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?
0
Comment
Question by:englm
  • 2
4 Comments
 
LVL 3

Expert Comment

by:bigelos
ID: 1607031
Try this macro (assuming you have the active document selected).

Sub MAIN
EditSelectAll
EditClear
End Sub

0
 

Author Comment

by:englm
ID: 1607032
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
 
LVL 3

Expert Comment

by:bigelos
ID: 1607033
What version of Word are you using?  
EditSelectAll and EditClear are both WordBasic commands in Word 7.0.


0
 
LVL 10

Accepted Solution

by:
rbr earned 50 total points
ID: 1607034
Use

Selection.WholeStory
Selection.Cut
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
The blinking Office button 4 43
Outlook 2010 Archive 3 71
Vlookup nonexact IP address match 32 86
how to re-acticvate Office 2010 6 41
This article will show you how to use shortcut menus in the Access run-time environment.
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question