Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2007

Tip: Looking for answers? Try searching our database.

using macros on custom toolbars

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
USDC-Tony - 28 Sep 2007 21:26 GMT
Hi all,

I have developed a custom toolbar in which I us one of the buttons to
display the current name representing to directory the users are working with.
The problem I am having is trying to close MS Word without getting the
following response:

Do you want to save the changes to Normal.dot?

I've tried using the following code:

Sub AutoClose()

   NormalTemplate.Saved = True

End Sub

Sub FileExit()
   
   NormalTemplate.Saved = True
   Application.Quit SaveChanges:=wdDoNotSaveChanges

End Sub

It works okay if the user exits MS Word by selecting File and Exit.

When they click on the upper right-hand corner on the 'X' it gives me the
message as stated above.

Can anyone help,  it would be very appreciated.

Thanks,

Tony
Suzanne - 01 Oct 2007 14:00 GMT
Go to options
Under Save tab uncheck 'Prompt to save Normal template'

or

Sub CloseDoc()

Options.SaveNormalPrompt = False
Application.Quit
       
temp = Options.SaveNormalPrompt

End Sub

> Hi all,
>
[quoted text clipped - 30 lines]
>
> Tony
USDC-Tony - 01 Oct 2007 16:36 GMT
Hi Suzanne,

I added your code but I was not sure how to access it when the user closes
the document using the 'X" on the upper right corner.  I guess I need to trap
for the close command and call this sub.  I guess I need some help here..

Thanks,

Tony

> Go to options
> Under Save tab uncheck 'Prompt to save Normal template'
[quoted text clipped - 44 lines]
> >
> > Tony
Suzanne - 01 Oct 2007 23:11 GMT
I did have a similar situation.  Most of mine was resolved by just unchecking
the option box (only a couple of people use the form I put together).

I tried this again before I sent it to you... after plugging it in, run it
(to ensure you didn't miss anything), then close the VB window and save your
document.  I was able to go back and forth to my document at different
'Normal' settings with no problem (even with the option box checked).

Suz

> Hi Suzanne,
>
[quoted text clipped - 54 lines]
> > >
> > > Tony
USDC-Tony - 02 Oct 2007 14:59 GMT
Hi Suz,

I should clarify some more.  In a court setting, all documents have
been set with the appropriate font, etc...  All the users are using
the same Normal.dot file that  they can not change...  This is all
done deliberately to control case forms data...  That's why what I'm
asking here is a little confusing because:
1) I don't know how MS Word environment handles macros and event
trapping.
2) Maybe it just can't be done...

I know through some reading that there are some macros that are run
that all start with auto...  I want to trap for the AutoClose event
if possible...

What is causing error to come up is the fact that I have 2 toolbars I have
created.
One has the desired macros that enable the users to move documents as to
progress through the court systems.  The files are stored and move within a
directory for each Judge.
The second toolbar is used simple to display the Judge's Name to imform the
users whose documents they are working with.
I tried displaying the Judge's Name on the active window caption field and
the

"Do you want to save the changes to Normal.dot?" message would come up when
the 'X' was clicked.

So I tried the second toolbar approach and it seems to work better because
at least it enables me to select the File and Exit method that I can trap and
works fine.

The problem is that the majority of the users like to hit the 'X' and again
the above message comes up.   Is there a better approach then the one I'm
using???

Any help at this point would be helpful...

Thanks,

Tony

> Hi all,
>
[quoted text clipped - 30 lines]
>
> Tony
Russ - 08 Oct 2007 03:55 GMT
Tony,
See this link for more discussion about capturing Quit Application:
http://tinyurl.com/37u5er

> Hi Suz,
>
[quoted text clipped - 73 lines]
>>
>> Tony

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.