Save document as a copy

A

Alexander Mueller

Hi @ all

When saving the ActiveDoc with "SaveAs" the ActiveDoc
changes to the newly created one.

Can I somehow copy the ActiveDoc without changing the ActiveDoc
and without displaying the new one? I want to process the new doc
in the background, then close it.

I tried VBA.FileCopy but that don't work since the ActiveDoc of course
is opened and so I get an "Access denied"-errmsg.

Any better built-in way?

MfG,
Alex
 
J

Jonathan West

Alexander Mueller said:
Hi @ all

When saving the ActiveDoc with "SaveAs" the ActiveDoc
changes to the newly created one.

Can I somehow copy the ActiveDoc without changing the ActiveDoc
and without displaying the new one? I want to process the new doc
in the background, then close it.

I tried VBA.FileCopy but that don't work since the ActiveDoc of course
is opened and so I get an "Access denied"-errmsg.

Any better built-in way?

MfG,
Alex

How to copy an open file using VBA
http://www.word.mvps.org/FAQs/MacrosVBA/CopyOpenFile.htm
 
H

Helmut Weber

Hi Alex,

I think you need a version management,
and standardized file names like:

bridge-01.doc
bridge-02.doc
bridge-03.doc

can all be done.

However, maybe this is sufficient for you.

Sub Test3()
Dim sNam As String
With ActiveDocument
sNam = .Name
.Save
.SaveAs "Copy" & sNam
.SaveAs sNam
End With
End Sub


Of course, it doesn't make a copy of an open doc,
but, IMHO, that wasn't what you intended anyway.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
R

Russ

There is some version management using the menu File/Versions...
At least, I see it in my MacWord 2004
 
H

Helmut Weber

Hi Russ,

according to what I know,
Word-version management encapsulates all versions into one file.

If that file is broken, then its over.

I like to read your postings. :)

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
R

Russ

Helmut,
Thanks for the info and compliment. The feeling is mutual. I have learned a
lot from you and the other regulars in these forums.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top