Solved

FileSave, FileSaveAs custom macros - are not triggered

Posted on 2004-09-14
10
814 Views
Last Modified: 2008-02-01
I have to handle special procedures on File Save and File Save As event.
In order to do that I created FileSave and FileSaveAs macros (as suggested by manual)
For some reason those events are not triggered by save and save as action.
At the same time FilePrint and FilePrintDefault macros are startded with print action.
Any reason why FileSave is not starting?
0
Comment
Question by:izakhar
  • 5
  • 4
10 Comments
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 12059889
What is the name of your macro?  And where is it stored?  It should be in normal.dot and read:

Sub FileSave()
   'run macro here
    Dialogs(wdDialogFileSave).Show
End Sub

or

Sub FileSaveAs()
    'run macro here
    Dialogs(wdDialogFileSaveAs).Show
End Sub




0
 

Author Comment

by:izakhar
ID: 12059954
I'm using custom global template macros.dot
It handles all code.

SaveAs starts if placed in Normal.dot
It doesn't work is placed in macros.dot

but

FileNew, FilePrint are working in macros.dot
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 12060063
Is your template stored in the proper startup folder?  If your template is named macros.dot - try this code:

Sub FileSaveAs()
    Application.Run ("FileSaveAs")
    Dialogs(wdDialogFileSaveAs).Show
End Sub

See if that works.

Here's how to run a macro from another template:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/off2000/html/womthRun.asp
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:izakhar
ID: 12060125
You know,
the problem is it never goes to Sub FileSaveAs()

yes, my template is stored in proper startup folder. It has hundreds procedures  and everything is working. It has custom macros for build in function (like FileNew) and those are working either.

The only problem is with FileSave and FileSaveAs.

Anyway, thank you very much for your answers!!!
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 12060154
Sorry - My code was wrong:

Sub FileSaveAs()
   'run your code here
    Application.Run MacroName:="macros.dot.NewMacros.FileSaveAs"  ' You may need to change the module or template name here
    Dialogs(wdDialogFileSaveAs).Show
End Sub

0
 

Author Comment

by:izakhar
ID: 12060215
Yes, I can set reference to that procedure from normal.dot, but I would like to keep normal.dot clean of any code

Sorry, it looks for me as corruption of world (I did already reinstall).
I'm going to check how it is working on other computer.
0
 
LVL 37

Accepted Solution

by:
Joanne M. Orzech earned 500 total points
ID: 12060242
I am saying - set it to your macros.dot and try running it from there....

Maybe I should just give up and let the other experts see what they come up with izakhar.
0
 

Author Comment

by:izakhar
ID: 12070139
I found what problem is.

We have got conflict between macros.

There are a bunch of global templates in start up folder developed by 3rd party (those project are protected from viewing - this is only excuse for me). One of that macro has 3 procedures in it: FileOpen, FileSave, FileSaveAs.
Only one appearance of procedure with name assigned to MS World built in command is allowed for all templates located in start up folder.

Otherwise only one procedure will be executed and all other with the same name will be ignored.

The reason why procedures in my macro are ignored and in other template are executed is in template name. MS Word is looking in alphabetical order, i.e. aaa.dot.FileSave comes before bbb.dot.FileSave. (The highest priority has Normal.dot and after that all other templates in alphabetical order).

Sorry, you could not figure that out because you did not have complete picture.

Thanks!
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 12073994
In any event, I am very glad you got it resolved izakhar.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When creating Microsoft Word-based forms there may be a need to have a form field repeated throughout the whole document. For instance, with a company name, you may want this information repeated automatically throughout the document rather than man…
Nice table. Huge mess. Maybe this was something you created way back before you figured out tabs or a document you received from someone else. Either way, using the spacebar to separate the columns resulted in a mess. Trying to convert text to t…
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question