Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    FileSave, FileSaveAs subs not being accessed (Word 2000/Sr1)

    To handle some special requirements I am using the subs FileSave and FileSaveAs in a module but these subs are not being accessed when I select Save or SaveAs from the menu nor if I use Ctrl-S. This must be due to something in the templates VBA code which is large because I can create a small template and place those subs there and those are getting accessed. In the template that doesn't work I do have a class but it only has an Open and New event. Also this template makes use of two COM addins with one of them having Beforeclose, beforesave events in them but these are for Excel not Word. The other COM addin creates a menu that is used in the template but none of the actions have anything to do with save events or functions. Any ideas?

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: FileSave, FileSaveAs subs not being accessed (Word 2000/Sr1)

    Jim, I'm having trouble sorting out all the information. Let's set aside Excel. Questions:
    1. <LI>If you press Alt+F8 to summon the Macros dialog, do your FileSave and FileSaveAs procedures appear in the macro list for "All Active Templates"?
      <LI>Assuming the answer to the above is Yes, do they run when you run them from the Macros dialog?
      <LI>Are the two procedures in a regular code module (not a class module)? (They should be in a regular code module.)
      <LI>Where are the two procedures stored: in the document, attached template, Normal.dot, global template?
    Hopefully, this will help diagnose.

  3. #3
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: FileSave, FileSaveAs subs not being accessed (Word 2000/Sr1)

    Thanks.

    Yes I have looked in the Macros list and these standard events appear in the All Active Templates but they do not appear in my specfic template list but I have discovered why I have had various problems with these templates( 30 of them). A co-worker in another department developed these templates and it is the way he developed them that has caused the problem. He initially developed them as doc files placing various VBA code in each doc and THEN changed them into templates by changing the extension to dot! He did this so that the VBA code would be cloned and placed into any Word doc that is derived from the dot rather than use the dot as reference, in this way the cloning of the modules is like Excel. Two problems that I have discovered with this way of creating Word templates, first resulting docs derived from these type of templates will always run the VBA code regardless of the security setting or if the user selects disable macros. Second, event such as FileSave, FileSaveAs, etc. do not get access in a doc that is derived from one of these templates. I have notified MS of this since one can write a simple Word doc derived from one of these types of templates having code that performs all kinds of nasty things to one's PC and get by all of the security.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •