DocumentBeforeClose event is now working for me
-
Montag, 25. Juni 2012 16:55
I'm writing a script to manage the Quit and Save events in Word 2010, some could help me with this piece of code?
The event word_Quit is working correctly. However the event word_DocumentBeforeClose isn't.
word = WScript.CreateObject("Word.Application") WScript.ConnectObject(word, "word_") word.visible = true bWordVisible = true while (bWordVisible) { WScript.Sleep(500) } function word_Quit () { bWordVisible = false WScript.Echo("You quit Word.") } function word_DocumentBeforeClose () { WScript.Echo("You switched documents.") }Any help would be appreciated. Thanks in advance.
Alle Antworten
-
Dienstag, 26. Juni 2012 17:05
Please, someone could help with this??
I tried with the correct method signature
function word_DocumentBeforeClose (document, cancel) { WScript.Echo("Document closed") }
But it also doesn't work. Please, help.
- Bearbeitet Daniel Peñalba Acitores Dienstag, 26. Juni 2012 17:08
-
Mittwoch, 27. Juni 2012 05:59Moderator
Hi,
Thanks for posting in the MSDN Forum.
Based on your issue, I would suggest you a thread which has the similar problem with you. Please try to set the document Saved property by referring to the following link I think would be helpful.http://social.msdn.microsoft.com/forums/en-us/vsto/thread/43DECE2F-5D09-486C-B501-13F4EBDCEC4A
In addition, I recommend you learning more about DocumentBeforeClose from this.http://msdn.microsoft.com/en-us/library/ff834271.aspx
If anything is unclear, please feel free to let me know.
Best Regards,
Leo_Gao [MSFT]
MSDN Community Support | Feedback to us
- Als Antwort markiert Leo_GaoModerator Montag, 2. Juli 2012 01:51

