Re: Recording a Macro to Delete A Day's Work

From: Pat Garard (apgarardATbigpondDOTnetDOTau)
Date: 12/18/04


Date: Sat, 18 Dec 2004 18:51:53 +1100

G'Day Teri,

The Macro language for Office is Visual Basic for Applications
and it still supports the "Kill" statement - an ancient leftover from
the dim and distant past.

IF
        all the files can be in the same folder
THEN
        the following macro will do the job
END IF
====
Sub DeleteAll()
Dim KillFilePath As String
    KillFilePath = "D:\My Documents\Test\*.*"
    Kill KillFilePath
    MsgBox KillFilePath & vbCrLf & "all files were deleted!"
End Sub
====
Change the folder path of KillFilePath to suit, and you may
also change "*.*" to "*.doc" - but only if you need to.

"*.*" will clean up any temporary files that might get left
over in the event of Word misbehaving.

If there are no files, you will get a non-trappable error
that says "File not found" (press Cancel).

Test it and, better yet, get your colleagues to test it with
and without files.

-- 
Regards,
Pat Garard
Australia
_______________________
"Teri D MT" <teridarcy@aol.com> wrote in message 
news:3EEDB73D-8621-483C-80D0-AD53339CC233@microsoft.com...
> Hello!  I am trying to help some of my coworkers learn to use Word.  Since 
> we
> type medical info, we are not allowed to keep patient information on our
> computers (we work at home for a hospital).  I would like to make a macro
> that we could run that would automatically find and delete all the 
> dictation
> that we typed that day so that it will not stay in our computers.  I 
> myself
> of course know how to delete files manually, but some of the newer users 
> are
> petrified of trying anything, so I'd like to make them a macro to do it 
> for
> them until they get a little more used to Word.  Thank you for any help.
> -- 
> Teri D MT 


Relevant Pages

  • Re: fax from word or outlook
    ... If you want to merge to a faxmodem and your merge is fairly simple you could try the following macro. ... I was unable to make this macro work on client computers connected to the Shared Fax Service that is provided as part of Microsoft's Small Business Server 2003. ... Dim bFaxServerAvailable As Boolean ... ' DisplayName is a "user-friendly" name used ...
    (microsoft.public.word.mailmerge.fields)
  • Re: How to Merge data from an ascii file into a Word Doc
    ... position in turn and run the macro InsertLineVariable. ... Dim oVars As Variables ... Dim vVar As Variant ... Dim iCount As Integer ...
    (microsoft.public.word.docmanagement)
  • Re: Kill a Macro?
    ... that the execution goes back to the calling routine after the called routine ... first macro in File 1 open File 2? ... Dim pwkbDestination As Workbook ... 'Update button in user file Account Summary Sheet runs this macro ...
    (microsoft.public.excel.programming)
  • Re: Add rows/form fields on doc w/ multiple tables & calculate
    ... ' Macro written 12/01/2003 by Charles Kyle Kenyon ... Dim oTemplate As Template ... .CorrectInitialCaps = True ... Sub InsertRowAboveMe() ...
    (microsoft.public.word.vba.general)
  • Re: condition formula in Word 2003
    ... It includes a macro to reset the address. ... Sub AutoNew() ... Dim SettingsFile As String ...
    (microsoft.public.word.docmanagement)