Solved

How to clear contents of a Word document prgrammatically

Posted on 1998-01-05
4
318 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
excel forecast function 1 30
Formatting Problem within Excel 3 51
TT Auto Dashboard 13 82
MS Printer Preview Searchs for Printers 16 21
Have you ever had the experience that you had to follow 10 steps over and over again every time when you need to nicely forward an important email to your manager? Fear no more! With the help of the Quick Steps feature in Outlook 2010, your old chor…
Outlook Free & Paid Tools
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

919 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now