Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-06-2013, 09:36 AM
etippelt etippelt is offline Adding macro to normal.dotm programmatically Windows XP Adding macro to normal.dotm programmatically Office 2007
Novice
Adding macro to normal.dotm programmatically
 
Join Date: Apr 2013
Posts: 3
etippelt is on a distinguished road
Smile Adding macro to normal.dotm programmatically

Here is my challenge:
As part of a customised application installation, I need to insert an autoexec macro into Normal.dotm. I cannot use the startup folder as this is a network shared location and the addins I need to load are licensed and cannot be generally available.
I have set up a local trusted folder in which the addins are installed, and I have enabled the use of VBA code in the trust centre. The macro I have created works fine when added manually to Normal.dotm, but I can't expect users to go through the process of adding the macro themselves, so I want to do this through code using the Word automation object. Unfortunately I am not a programmer and struggle with the coding of automation scripts. I have exported my macro as a .BAS file, so all that is left is some vbscript code (ideally) that will load the word object and poke the macro code into Normal.dotm.


Can anyone help me with the code, or point me at a web resource where I can find some code that I can adapt. Needless to say I have spent a long time Googling on various search strings to find an answer, but so far to no avail. I do understand that direct editing of Normal.dotm is not the preferred way of doing this, but in our particular circumstances, that is the only way that maintains compatibility with all the different implementations of Office 2007 at our University.
Reply With Quote
  #2  
Old 04-06-2013, 05:21 PM
fumei fumei is offline Adding macro to normal.dotm programmatically Windows 7 64bit Adding macro to normal.dotm programmatically Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

Let me see if I understand. You want some NON-VBA script to write your macro into every users Normal. I am not sure you CAN poke the BAS file into Normal with a non-VBA solution.

You can use VBA to do it, importing the BAS file. Although you will have to open the Normal file first.

I am not quite following why this is needed. Add-ins do not have to be in Startup, they can be in any folder including network folders.
Reply With Quote
  #3  
Old 04-07-2013, 02:00 AM
macropod's Avatar
macropod macropod is offline Adding macro to normal.dotm programmatically Windows 7 64bit Adding macro to normal.dotm programmatically Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,363
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Cross-posted at: http://social.msdn.microsoft.com/For...7-0f597bb1293b
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 04-07-2013, 08:30 AM
etippelt etippelt is offline Adding macro to normal.dotm programmatically Windows XP Adding macro to normal.dotm programmatically Office 2007
Novice
Adding macro to normal.dotm programmatically
 
Join Date: Apr 2013
Posts: 3
etippelt is on a distinguished road
Default Can you specify more than one Word startup folder?

If I can clarify the requirement:
1. The Word startup folder is located on a network share and applies to all Office users in the department concerned, via Group Policy
2. The word addins I need to deploy cannot be made available to all users due to licensing.
3. I have been unable to determine whether it is possible to specify a second (or third) startup folder locally.
4. The addins need to load automatically as word starts up. No other user action should be involved.
5. I have created a solution which consists of an autoexec macro which is added to Normal.dotm manually. This does the job perfectly.
6. I have the macro code exported as a BAS file.
7. I need a solution that can run via Active Setup which will add this macro code to the user's Normal.dotm (which is in their personal profile), as I cannot find any other way to achieve the automatic startup of these addins.
I have successfully achieve similar results when adding add-ins to Excel, but I do understand that each Office app comes from a different stable and they do not behave in similar ways.
Therefore, if you can provide me with some pointers to VBA code that I can run as a standard (non admin) user which will mount the Normal.dotm file, edit it, and then dismount and save the file, I would be very happy.
If you can provide an alternative solution for automatically starting Word add-ins from a local folder then please share with me. I have been googling on this issues for many days on and off, so any help you can render would be most welcome.
Reply With Quote
  #5  
Old 04-07-2013, 08:45 AM
etippelt etippelt is offline Adding macro to normal.dotm programmatically Windows XP Adding macro to normal.dotm programmatically Office 2007
Novice
Adding macro to normal.dotm programmatically
 
Join Date: Apr 2013
Posts: 3
etippelt is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Response posted in other forum....
Ed
Reply With Quote
  #6  
Old 04-07-2013, 05:08 PM
macropod's Avatar
macropod macropod is offline Adding macro to normal.dotm programmatically Windows 7 64bit Adding macro to normal.dotm programmatically Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,363
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Per your repsonse in the other forum:
Quote:
I am aware that my problem is not going to be an easy fix and therefore the wider the audience, the better my chances of getting ONE solution, which is all I need. Either you know how to do it or you don't - I don't believe anyone is going to waste loads of time on my posting if they have no clue on how to answer it, and I note that you have not offered any possible solutions either.

FYI, I have been doing forum support online for 29 years and have posted over 40,000 times on just one of the forums I support, so I would like to reassure you that I understand about forum etiquette.
That's hardly an excuse for ignoring the etiquette (i.e. providing links).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 04-08-2013, 05:55 PM
fumei fumei is offline Adding macro to normal.dotm programmatically Windows 7 64bit Adding macro to normal.dotm programmatically Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

If I can clarify the requirement:
1. The Word startup folder is located on a network share and applies to all Office users in the department concerned, via Group Policy
2. The word addins I need to deploy cannot be made available to all users due to licensing.
3. I have been unable to determine whether it is possible to specify a second (or third) startup folder locally.
4. The addins need to load automatically as word starts up. No other user action should be involved.
5. I have created a solution which consists of an autoexec macro which is added to Normal.dotm manually. This does the job perfectly.

1. There is still a Startup locally

2. There seems to be a bit of a conflict here. If these are NOT available to some users, how does this balance to #4 - that they are loaded automatically. Does your autoexec test the username somehow

3 see #1...there is still a local Startup

4. Some addins, all of them...what

5. perhaps post what is in that autoexec.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding macro to normal.dotm programmatically New template/New normal.dotm kenglade Word 3 12-19-2011 04:00 PM
Adding macro to normal.dotm programmatically How to get to normal.dotm Aiken_Bob Word 4 05-02-2011 02:41 PM
Macro will not save to normal.dot file when exiting bobbraun Word 1 09-28-2010 06:26 AM
Adding macro to normal.dotm programmatically Word 2007 crashes due to corrupt normal.dotm stevebond001 Word 1 05-11-2010 10:49 AM
Macro for automatically adding filename without .doc RPM7 Word VBA 0 04-29-2010 01:43 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:26 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft