Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VBA Autoopen Macro to control file menu
Message
Information générale
Forum:
Microsoft Office
Catégorie:
Word
Divers
Thread ID:
01245451
Message ID:
01245846
Vues:
19
>>The state of what?
>>
>>This is what I have in my application for similar task:
>>
>>
>>&& Form.Init
>>thisform.oWord = CREATEOBJECT("Word.Application")
>>*  store information like visible,
>>*      enabled, etc in the apporpriate dataset. I am using array:
>>thisform.saveoriginalwordbars()
>>
>>WITH thisform.oWord
>>	FOR ia=1 TO ALEN(thisform.OriginalWordBars,1)
>>* do whatever you need with them
>>.....
>>
>>&& Form.Close/destroy/release....
>>
>>thisform.restoreoriginalwordbars()
>>....
>>
>
>I've tried a quick experiment and I got prompted about saving my changes to Normal.dot document when I tried to close Word.
>
>So, the question is how to restore the settings before an attempt to close?
>
>Or do you disable the Exit item in the menu too? And close Word yourself when close the form?

Naomi,

What does it mean "quick experiment", how do you open the document (readonly, protected,...), how do you close it,... See Word VBA Help on these methods, and review parameters that you can set.


In any case, if you want to control the Word behavior from VFP then there are several options to address exactly what you wish:
- Open document as readonly
- add the password/protect the document
- hide all Word Menus including Close document/Quit
- disable Word Window TitleBAr with buttons close/minimize etc
- put the Word Window inside your form
- use event handling
- etc...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform