Solved

FileSave, FileSaveAs custom macros - are not triggered

Posted on 2004-09-14
10
782 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
 

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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I would like to show you some basics you can do with Mailings in MS Word. It´s quite handy feature you can use for creating envelopes, labels, personalized letters etc. First question could be what is this feature good for? Mailing can really he…
Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
This video teaches the viewer how to align pictures around text while keeping the text properly aligned in the document.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now