Re: Recording a Macro to Delete A Day's Work
From: Pat Garard (apgarardATbigpondDOTnetDOTau)
Date: 12/18/04
- Next message: Pat Garard: "Re: Recording a Macro to Delete A Day's Work"
- Previous message: Teri D MT: "Re: Recording a Macro to Delete A Day's Work"
- In reply to: Teri D MT: "Recording a Macro to Delete A Day's Work"
- Next in thread: Sam Hobbs: "Re: Recording a Macro to Delete A Day's Work"
- Reply: Sam Hobbs: "Re: Recording a Macro to Delete A Day's Work"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Pat Garard: "Re: Recording a Macro to Delete A Day's Work"
- Previous message: Teri D MT: "Re: Recording a Macro to Delete A Day's Work"
- In reply to: Teri D MT: "Recording a Macro to Delete A Day's Work"
- Next in thread: Sam Hobbs: "Re: Recording a Macro to Delete A Day's Work"
- Reply: Sam Hobbs: "Re: Recording a Macro to Delete A Day's Work"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|