Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VBA Autoopen Macro to control file menu
Message
General information
Forum:
Microsoft Office
Category:
Word
Miscellaneous
Thread ID:
01245451
Message ID:
01245846
Views:
15
>>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...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform