DocumentBeforeSave Event error

A

Amy S

Hi, everybody.

I am trying to move file from one folder to another, back and forth
depending on user's actions.

However, when the move file procedure is triggered by the DocumentBeforeSave
event, Word shuts down completely with the message

"Microsoft Office Word has encountered a problem and needs to close. We are
sorry for the inconvenience",

and I am not able to trap this error.

File is successfully moved if the sub is called by subs other than
DocumentBeforeSave.

Please help. I have spent close to 2 weeks on this problem.
 
M

Mary

Hi Amy, I teaching Microsoft Word and I move files all the time. The
easiest way to move your files is to go to my computer. Open up the
folder where your files are located and right click on the file you
want move and just copy it or cut it into the new folder in which you
want it placed. I find it easier to do it this way.

Mary
 
A

Amy S.

Mary, thanks but I am trying to move files programmatically using
EventClassModule (example found on MSDN).

I looked more into it, and seems that the cause of the problem is that after
saving the document itself, it performs my MoveFile procedure;
then, Word tries to save the attached template. However, the argument to
DocumentBeforeSave - doc As Document - does not exist anymore.

and that's where Word shuts down.

How can I prevent Word from trying to save the attached template when
trapping the DocumentBeforeSave event?

Please help.

P.S. my MoveFile procedure works very well if triggered by anything else
other than DocumentBeforeSave event.
 

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