Copying open .doc to .wbk folder

D

Dave Neve

Hi

I have Word configured to make a .wbk copy of every .doc opened which is
then places in the same folder as the original.

I would like to do this with my own macro instead so that I can put the .wbk
copy into a special folder.

It'd be nice if the macro executed on closing the document.

At the moment, I am trying to see what snippets of code I need and how they
work.

To write my macro, I guess I need

Sub 1()

a To get the name of the active document
b To copy the active document and give it the same name
but with the extension .wbk
f To save to a specific file

In order to get and change name

Function 1()
c To get the name of active doc and give it a range
d To change the extension
e To give this name back to line b

Any chance of an idea of what this code would look like as it's my birthday
soon!!!
 
D

DA

Hi Dave

In answer to questions:
a) ActiveDocument.Name will return you the document name.
b) ActiveDocument.SaveAs FileName:=ActiveDocument.Name
+ ".wbk" would save the document with a .wbk extension.

Good place to start when you're learning about VBA like
this would be to use your macro recorder. Perform the
actions you want manually, then look at the recorded code
to see how it's done.

Good luck and Happy Birthday :)
Dennis
 

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