Catch when the user presses the save button

N

neoret

Hello.

I need to catch when the user presses the save button in word. I tried
to use the documentbeforesave method, but that one also cathces the
autosave from word. This is not wanted.

I really hope someone could give a hint on this challenge :)

..e
 
J

Jezebel

You have several possibilities.

1. Write a macro with the same name as the command you're trying to catch:
In this case, FileSave (if you mean the menu Save option) or FileSaveDefault
(if you mean the toobar save button). This will run in place of the
corresponding built-in command. Note that it's *entirely* up to you what
this macro does -- if your macro doesn;t save the document, then document
doesn't get saved.

2. Remove the built-in button and replace it with your own, running whatever
macro you want to run.
 
N

neoret

Thank you for answering.

I'm not very experienced in word programming -

- can I write the macro in my add-in code or how is that accomplished?

- could you give me some hints on how to implement alternative 2? Do
you have any examples, articles about this etc??

Thanks again for answering me :)

..n


Jezebel skrev:
 
J

Jezebel

Thank you for answering.

I'm not very experienced in word programming -

- can I write the macro in my add-in code or how is that accomplished?

Yes, you can write it in your add-in.

- could you give me some hints on how to implement alternative 2? Do
you have any examples, articles about this etc??

It's covered in Help. Right-click any toolbar, select Customize, and go from
there.
 

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