Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

FileSave, FileSaveAs custom macros - are not triggered

Posted on 2004-09-14
10
Medium Priority
?
890 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
Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

 

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 1000 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…

927 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