none
File preview in Explorer does not fire Autexec RRS feed

  • Question

  • Hi,

    We have a problem when users open documents from Windows Explorer AND has the preview window visible at the same time. It seems that in this case, an instance of Word is started in the background without running Autoexec in a global template NOR creating event handlers that we use. So it seems no code is running whatsoever in this scenario.

    1. Create an autexec module/macro with a message box. Store it a global template or Normal.dotm (I hope that works)
    2. Close any open Word application
    3. Open Windows Explorer, turn on the Preview Pane
    4. Find a Word document, point at at for preview
    5. Double click the document to open it
    6. No messagebox is displayed

    Also the creation of any event handlers will not take place in this scenario. None of the following code executed. This code is residing a module named Autoexec:

    ***********************************

    Public oWord As New WordClass
    
    Sub Main()
       MsgBox "autoexec"
       'Initiate Words application events
       Set oWord.App = Word.Application
    End Sub

    **************************************

    We have application events in a class module like App_NewDocument which performs certain tasks when, in this case, when a new document is created.

    But as the "Set oWord.App = Word.Application" resides in Autoexec, which never is executed in the above scenario, these events never fire.

    Is there anything one can do? Are there any registry settings that override this behaviour?

    Thanks,
    Peeter


    • Edited by pemok Thursday, February 11, 2016 9:17 AM clarification
    Wednesday, February 10, 2016 3:48 PM

Answers

  • >>>but I think I have explained exactly my problem. Have you understood the problem? Then have you followed the list above to reproduce it? Does it reproduce?

    I am surprised that no one in the Community has encountered this shortcoming behaviour.<<<

    Thanks very much for your detail steps to help us reproduce this issue. I’m able to reproduce this issue now. Unfortunately, I did not see any workaround to overcome this.

    So I suggest that you could submit any feedback to Word User Voice:

    http://word.uservoice.com/

    Thanks for your understanding.

    • Marked as answer by David_JunFeng Thursday, February 25, 2016 9:20 AM
    Tuesday, February 23, 2016 9:24 AM

All replies

  • >>>Is there anything one can do? Are there any registry settings that override this behaviour?

    According to your description, if you want to create AutoExec macro, you could refer to below steps:

    Create an AutoExec macro :

    a.Click the Developer tab, and then click Record Macro in the Code group.
    b.In the Record Macro dialog box, type AutoExec under Macro name, and then click OK. By default, the macro is saved in the Normal template. Click Stop Recording in the Code group.
    c.On the Developer tab, click Macros in the Code group. Select AutoExec in the list of macros, and then click Edit.
    d.Add the following code to the AutoExec macro:

    MsgBox "You're seeing the AutoExec macro in action", vbMsgBoxSetForeground      


    e.In Microsoft Visual Basic Editor, click Save Normal on the File menu, and then close Visual Basic Editor.

    For more information, click here to refer about Description of behaviors of AutoExec and AutoOpen macros in Word


    Thursday, February 11, 2016 9:08 AM
  • Thank you,

    but my problem is not how to create an autoexec macro. Please read trough my description of the problem above. If my description is unclear, please ask for clarification.

    Peeter

    Thursday, February 11, 2016 9:20 AM
  • Hello,

    I would be very pleased if anybody could comment on this issue.

    1. Is the above mentioned scenario a known fact?
    2. Are there any known workarounds or ideas?

    Thanks,
    Peeter

    Friday, February 12, 2016 12:50 PM
  • Hi, pemok

    Could you provide more information about issue, for example sample file, sample code, screenshot etc., that will help us reproduce and resolve it.

    Thanks for your understanding.

    In addition you can respond to certain application-level events using Auto macros. However, to respond to other application events you need to create an application object declared “WithEvents” – i.e. declared in such a way that it will respond to events.

    For more information, click here to refer about Writing application event procedures

    Disclaimer: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    Thursday, February 18, 2016 9:30 AM
  • Thanks again,

    but I think I have explained exactly my problem. Have you understood the problem? Then have you followed the list above to reproduce it? Does it reproduce?

    I am surprised that no one in the Community has encountered this shortcoming behaviour.

    Peeter

    Thursday, February 18, 2016 1:30 PM
  • >>>but I think I have explained exactly my problem. Have you understood the problem? Then have you followed the list above to reproduce it? Does it reproduce?

    I am surprised that no one in the Community has encountered this shortcoming behaviour.<<<

    Thanks very much for your detail steps to help us reproduce this issue. I’m able to reproduce this issue now. Unfortunately, I did not see any workaround to overcome this.

    So I suggest that you could submit any feedback to Word User Voice:

    http://word.uservoice.com/

    Thanks for your understanding.

    • Marked as answer by David_JunFeng Thursday, February 25, 2016 9:20 AM
    Tuesday, February 23, 2016 9:24 AM