|
| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Wed May 09, 2007 9:06 am Post subject: [Word 2007] Disable or repurpose X close button |
|
|
Hi,
I need to know if there is a way to disable the X close button because
the add-in I am developing for Word 2007 is having errors if we quit
the word application using the X close button.
I've been able to able to repurpose the FileExit in the Office Menu by
writing a vba macro which is
"Sub FileExit(control As IRibbonControl, ByRef cancelDefault)"
and in the XML file: <command
idMso="FileExit"
onAction="FileExit"/>
I tried to repurpose the X close button by adding this in the XMl
file:
<command
idMso="WindowClose"
onAction="FileExit"/>
but it seems to be out of reach this way.
I thought about using only VBA to reach the X close button but didnt
have find yet.
More over, i'd like to disable specific options in the word Options
dialog but it's not possible using custom Ui XML so I thought about
using VBA also with Application.options as it was possible in word
2003 but need to know the new properties and object model.
I have been searching on microsoft websites, newsgroups, P.Schmidt (Hi
^^) forums and what else... well a lot of others websites.
If someone could answer this it would be great
kind regards, ^____^ |
|
| Back to top |
|
 |
Google Sponsor

|
Posted: Wed May 09, 2007 9:06 am Post subject: Advertisement |
|
|
|
|
| Back to top |
|
 |
Perry Guest
|
Posted: Wed May 09, 2007 6:46 pm Post subject: Re: [Word 2007] Disable or repurpose X close button |
|
|
Eventhough disabling/repurposing the X button (Application Close)
functionallity through VBA is possible using API calls.
However, without critisizing your app but I would invest in analysing what
the problems are.
Do you have a process going on in your application, needing Word to be
active?
If so, can't you make the target Word instance invisible rather then
disabling the X button?
What are the problems your running into ?
Btw, another implication of disabling the X button, this will also interfere
with users trying to quit the current Word instance using the UI File menu
option in pre Word 2007 versions and users trying to quit MS Word using the
Office button in Word 2007.
--
Krgrds,
Perry
System:
Vista/Office Ultimate
VS2005/VSTO2005 SE
<mister.tree@gmail.com> schreef in bericht
news:1178701587.466972.143750@o5g2000hsb.googlegroups.com...
| Quote: | Hi,
I need to know if there is a way to disable the X close button because
the add-in I am developing for Word 2007 is having errors if we quit
the word application using the X close button.
I've been able to able to repurpose the FileExit in the Office Menu by
writing a vba macro which is
"Sub FileExit(control As IRibbonControl, ByRef cancelDefault)"
and in the XML file: <command
idMso="FileExit"
onAction="FileExit"/
I tried to repurpose the X close button by adding this in the XMl
file:
command
idMso="WindowClose"
onAction="FileExit"/
but it seems to be out of reach this way.
I thought about using only VBA to reach the X close button but didnt
have find yet.
More over, i'd like to disable specific options in the word Options
dialog but it's not possible using custom Ui XML so I thought about
using VBA also with Application.options as it was possible in word
2003 but need to know the new properties and object model.
I have been searching on microsoft websites, newsgroups, P.Schmidt (Hi
^^) forums and what else... well a lot of others websites.
If someone could answer this it would be great
kind regards, ^____^
|
|
|
| Back to top |
|
 |
Guest
|
Posted: Tue May 15, 2007 9:44 am Post subject: Re: Disable or repurpose X close button |
|
|
Old version of my app was launching word 2003,2000,97 in order to
perform specific tasks from the app. Minimize,restore and close
buttons (top-right corner of the window) were disabled(not visible in
fact) using API calls. And close ,quit ,open etc in Word file menu
were repurposed with own vba macros.
The fact is when we started to look if our old xxx.dot file(containing
all vba macros) was running on the new Word 2007, we noticed all vba
macros were compatible but only minize button was disabled (in fact
not visible as in old version) but not others buttons restore and
close.
So the app launches Word and loads a template file (.dot) and now a
new template (which customise the ribbon UI, .dotm), both are loaded
if a version of Word 2007 is detected. The app allows users to write
specific mails using our macros in a customised Word then we need Word
to be visible. I don't really care about restore button, more with the
X close button. I've been able to repurpose the File Exit button in
the Office menu (word 2007) with a macro which quits Word and makes
others things, I'd like to force users to quit Word using this button.
For example, if you quit word launched by my app with the x close
button , there will be a msgbox from the app asking if you want to
save your document(we save documents in a database) and after the word
2007 msgbox asking you if you want to save your document (local) and
we don't want that, but there are others problems due to this X close
button.
We want to make this button not visible. It seems on Word 2007 you
can't disable X close button(make it not visible) using API calls the
same way as in old versions of Word. We had prefer to repurpose it but
it seems to be out of reach so we want to disable it, it would be
easier instead of investigate all errors that could occur if you quit
word using X close button.
sorry about my poor english, I hope you can understand what I tried to
explain :-D
kind regards,
_______________
Arnaud H. |
|
| Back to top |
|
 |
Guest
|
Posted: Tue May 15, 2007 9:49 am Post subject: Re: Disable or repurpose X close button |
|
|
Old version of my app was launching word 2003,2000,97 in order to
perform specific tasks from the app. Minimize,restore and close
buttons (top-right corner of the window) were disabled(not visible in
fact) using API calls. And close ,quit ,open etc in Word file menu
were repurposed with own vba macros.
The fact is when we started to look if our old xxx.dot
file(containing
all vba macros) was running on the new Word 2007, we noticed all vba
macros were compatible but only minize button was disabled (in fact
not visible as in old version) but not others buttons restore and
close.
So the app launches Word and loads a template file (.dot) and now a
new template (which customise the ribbon UI, .dotm), both are loaded
if a version of Word 2007 is detected. The app allows users to write
specific mails using our macros in a customised Word then we need
Word
to be visible. I don't really care about restore button, more with
the
X close button. I've been able to repurpose the File Exit button in
the Office menu (word 2007) with a macro which quits Word and makes
others things, I'd like to force users to quit Word using this
button.
For example, if you quit word launched by my app with the x close
button , there will be a msgbox from the app asking if you want to
save your document(we save documents in a database) and after the
word
2007 msgbox asking you if you want to save your document (local) and
we don't want that, but there are others problems due to this X close
button.
We want to make this button not visible. It seems on Word 2007 you
can't disable X close button(make it not visible) using API calls the
same way as in old versions of Word. We would prefer to repurpose it
but
it seems to be out of reach so we want to disable it, it would be
easier instead of investigate all errors that could occur if you quit
word using X close button.
sorry about my poor english, I hope you can understand what I tried
to
explain :-D
kind regards,
_______________
Arnaud H. |
|
| Back to top |
|
 |
Guest
|
Posted: Tue May 15, 2007 9:54 am Post subject: Re: Disable or repurpose X close button |
|
|
Old version of my app was launching word 2003,2000,97 in order to
perform specific tasks from the app. Minimize,restore and close
buttons (top-right corner of the window) were disabled(not visible in
fact) using API calls. And close ,quit ,open etc in Word file menu
were repurposed with own vba macros.
The fact is when we started to look if our old xxx.dot
file(containing
all vba macros) was running on the new Word 2007, we noticed all vba
macros were compatible but only minize button was disabled (in fact
not visible as in old version) but not others buttons restore and
close.
So the app launches Word and loads a template file (.dot) and now a
new template (which customise the ribbon UI, .dotm), both are loaded
if a version of Word 2007 is detected. The app allows users to write
specific mails using our macros in a customised Word then we need
Word to be visible. I don't really care about restore button, more
with the
X close button. I've been able to repurpose the File Exit button in
the Office menu (word 2007) with a macro which quits Word and makes
others things, I'd like to force users to quit Word using this
button.
For example, if you quit word launched by my app with the x close
button , there will be a msgbox from the app asking if you want to
save your document(we save documents in a database) and after
the word 2007 msgbox asking you if you want to save your
document (local) and we don't want that, but there are others
problems due to this X close button.
We want to make this button not visible. It seems on Word 2007 you
can't disable X close button(make it not visible) using API calls the
same way as in old versions of Word. We would prefer to
repurpose it but it seems to be out of reach so we want to disable it,
it would be easier instead of investigate all errors that could
occur
if you quit word using X close button.
sorry about my poor english, I hope you can understand what I tried
to
explain :-D
kind regards,
_______________
Arnaud H. |
|
| Back to top |
|
 |
Doug Robbins - Word MVP Guest
|
Posted: Tue May 15, 2007 11:13 am Post subject: Re: Disable or repurpose X close button |
|
|
Maybe you will find some ideas at:
http://vbnet.mvps.org/index.html?code/forms/killclose.htm
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
<mister.tree@gmail.com> wrote in message
news:1179222840.723612.57500@e51g2000hsg.googlegroups.com...
| Quote: | Old version of my app was launching word 2003,2000,97 in order to
perform specific tasks from the app. Minimize,restore and close
buttons (top-right corner of the window) were disabled(not visible in
fact) using API calls. And close ,quit ,open etc in Word file menu
were repurposed with own vba macros.
The fact is when we started to look if our old xxx.dot
file(containing
all vba macros) was running on the new Word 2007, we noticed all vba
macros were compatible but only minize button was disabled (in fact
not visible as in old version) but not others buttons restore and
close.
So the app launches Word and loads a template file (.dot) and now a
new template (which customise the ribbon UI, .dotm), both are loaded
if a version of Word 2007 is detected. The app allows users to write
specific mails using our macros in a customised Word then we need
Word to be visible. I don't really care about restore button, more
with the
X close button. I've been able to repurpose the File Exit button in
the Office menu (word 2007) with a macro which quits Word and makes
others things, I'd like to force users to quit Word using this
button.
For example, if you quit word launched by my app with the x close
button , there will be a msgbox from the app asking if you want to
save your document(we save documents in a database) and after
the word 2007 msgbox asking you if you want to save your
document (local) and we don't want that, but there are others
problems due to this X close button.
We want to make this button not visible. It seems on Word 2007 you
can't disable X close button(make it not visible) using API calls the
same way as in old versions of Word. We would prefer to
repurpose it but it seems to be out of reach so we want to disable it,
it would be easier instead of investigate all errors that could
occur
if you quit word using X close button.
sorry about my poor english, I hope you can understand what I tried
to
explain :-D
kind regards,
_______________
Arnaud H.
|
|
|
| Back to top |
|
 |
Patrick Schmid [MVP] Guest
|
Posted: Wed May 16, 2007 7:48 am Post subject: Re: Disable or repurpose X close button |
|
|
You are using RibbonX to repurpose the File, Exit command? How about the
File, Close command, are you also repurposing that one? If not, try
repurposing that and see if that doesn't give you what you want.
Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://ribboncustomizer.com
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed
"mister.tree@gmail.com" <mister.tree@gmail.com> wrote in message
news:1179222243.978468.32790@o5g2000hsb.googlegroups.com:
| Quote: | Old version of my app was launching word 2003,2000,97 in order to
perform specific tasks from the app. Minimize,restore and close
buttons (top-right corner of the window) were disabled(not visible in
fact) using API calls. And close ,quit ,open etc in Word file menu
were repurposed with own vba macros.
The fact is when we started to look if our old xxx.dot file(containing
all vba macros) was running on the new Word 2007, we noticed all vba
macros were compatible but only minize button was disabled (in fact
not visible as in old version) but not others buttons restore and
close.
So the app launches Word and loads a template file (.dot) and now a
new template (which customise the ribbon UI, .dotm), both are loaded
if a version of Word 2007 is detected. The app allows users to write
specific mails using our macros in a customised Word then we need Word
to be visible. I don't really care about restore button, more with the
X close button. I've been able to repurpose the File Exit button in
the Office menu (word 2007) with a macro which quits Word and makes
others things, I'd like to force users to quit Word using this button.
For example, if you quit word launched by my app with the x close
button , there will be a msgbox from the app asking if you want to
save your document(we save documents in a database) and after the word
2007 msgbox asking you if you want to save your document (local) and
we don't want that, but there are others problems due to this X close
button.
We want to make this button not visible. It seems on Word 2007 you
can't disable X close button(make it not visible) using API calls the
same way as in old versions of Word. We had prefer to repurpose it but
it seems to be out of reach so we want to disable it, it would be
easier instead of investigate all errors that could occur if you quit
word using X close button.
sorry about my poor english, I hope you can understand what I tried to
explain :-D
kind regards,
_______________
Arnaud H. |
|
|
| Back to top |
|
 |
Guest
|
Posted: Mon May 21, 2007 10:18 am Post subject: Re: Disable or repurpose X close button |
|
|
I've tried to repurpose the File, Close command as you suggested but
it doesn't reach the X close button but only the FileClose control in
the Office menu. I've found a way to investigate errors adding some
code in the AutoClose routine, since Word 2007 launches a new window
with every new document and has only one X close Button closing active
window, and closing the whole app if the active document is the last.
I noticed every time you close a document, Word calls this AutoClose
routine and if the active document is the last then Word calls
AutoExit routine. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|