Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

FileSave, FileSaveAs custom macros - are not triggered

Posted on 2004-09-14
10
Medium Priority
?
864 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 

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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Introduction Authors who set out to write any sort of lengthy piece for online submission—be it a long question or comment on a technical form, an article, or a substantial blog entry—often find it useful to work up a draft in an editor other t…
If you work with Word a lot, you probably use styles. If you use styles a lot, you've probably balled your fist more often than not when working with the ribbon. In Word 2007/2010, one of the things that I find missing when using styles is a quic…
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.
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…

705 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