Hello, people.

Is there a macro that could help me do the following:

I am working on a document named ABC that I have already saved on my
disk and want to save it with a different name, XYZ, while at the same
time getting rid of the ABC document stored on my disk, without having
to delete it by getting to its containing folder using Windows
Explorer.

Any ideas?

Regards,

Wtbx

Re: Saving a document as and automatically deleting the original by Helmut

Helmut
Thu Jun 24 12:29:09 CDT 2004

Hi,
not at the same time, but afterwards.
Remember old name
Oldname = activedocument.fullname
Dialogs(wdDialogFileSaveAs).Show
Kill oldname
You'll get an error if you cancel the dialog.
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98



Re: Saving a document as and automatically deleting the original by weetabx

weetabx
Thu Jun 24 19:30:52 CDT 2004

Thanks Helmut,

It sure is better than the one I came up with (I am posting it for you
to have a laugh!)

Sub Rename()

ActiveDocument.Save
Dim OldName, NewName
OldName = ActiveDocument.Name: NewName = InputBox("Supply file name",
"Rename", OldName) ' Define file name.
If NewName = "" Then
End
End If
ActiveDocument.Close
Name OldName As NewName
Documents.Open NewName

End Sub

Thanks,

Wtbx


Helmut Weber <elmkqznfwvccbf@mailinator.com> wrote in message news:<lg3md01vmcagcnf1893ngal6lsfck5bhr0@4ax.com>...
> Hi,
> not at the same time, but afterwards.
> Remember old name
> Oldname = activedocument.fullname
> Dialogs(wdDialogFileSaveAs).Show
> Kill oldname
> You'll get an error if you cancel the dialog.
> Greetings from Bavaria, Germany
> Helmut Weber, MVP
> "red.sys" & chr(64) & "t-online.de"
> Word XP, Win 98