Issue with DocumentBeforeSave Event

N

Naga

We have a Letters application(VB6) which opens the word document and the user
does some changes in it and save the file. We wanted to prevent the user from
saving the document with different name and we have added the following piece
of code in the documentbeforesave event

If Ucase(strFileName) = Ucase(Doc.Name) then
SaveAsUI = False
End If

This served my purpose and it is not displaying the Save As dialog box when
the user click on 'Save As' from the file menu.

The problem here is
The VB6 application opens the word document and by default saves the word
document with the name 'Letter_Template.doc' and the user modified some
contents in it and left it idle for 10 min and did some change after 10 min.
After that when they tried to close the word document, the word prompted the
message 'Do you want to save the changes to ~WRLxxxx.tmp' file.

Why the word document changes the filename from 'Letter_Template.doc' to
'~WRLxxxx.tmp'.

And when trying to find out the reason, I tried it by turning off the 'Save
AutoRecovery info every 10 min' then the application was working without any
problem.

Why it is working fine when I turn off the AutoRecovery and why it is not
working with AutoRecovery on?

Am I doing anything wrong here or it is the defect?
 
L

Larry Daugherty

Have you never understood the sins of multi-posting and the
corresponding benefits of cross-posting?

I've answered your issue in another newsgroup. If you had
cross-posted, my response would appear here. It doesn't and it never
will. Instead, you have multi-posted and can waste a lot of people's
time because they can't know that someone else in some other newsgroup
has already put your issue to rests.

To cross-post simply add other, relevant, newsgroups to your
newsgroups line. The general rule of thumb is no more than 3 groups.
More than that and it's assumed that you don't really know what you're
doing and your post is likely to remain unread and without response.

Continually blasting posts across large numbers of newsgroups OR
continually cross-posting will likely get you added to a lot of Bozo
lists. When people to that they will never hear from you again from
your current credentials.

HTH
 

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