Macros for All users in a lab

G

Greg

I have a macro that will automatically change the settings in the envelope
wizard for our current setup of printers. the printer with envelops is
different than the default printer used in the lab. Anyway, How can i set it
up so when a users logs into the computer and uses word, it automatically
puts this macro into action?
I created a template with the macro in it so it also changes the font
automatically but when i put it in the startup folder, the security settings
don't allow the macro to run. How can i get around this? I can change
security on the computers for macros, but then need to know how to change it
for every user on the computer and new users to who sign in as well.
Thanks
 
J

Jonathan West

Greg said:
I have a macro that will automatically change the settings in the envelope
wizard for our current setup of printers. the printer with envelops is
different than the default printer used in the lab. Anyway, How can i set
it
up so when a users logs into the computer and uses word, it automatically
puts this macro into action?
I created a template with the macro in it so it also changes the font
automatically but when i put it in the startup folder, the security
settings
don't allow the macro to run. How can i get around this? I can change
security on the computers for macros, but then need to know how to change
it
for every user on the computer and new users to who sign in as well.
Thanks

Distributing macros to other users
http://www.word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm

Running a macro automatically when Word starts or quits
http://www.word.mvps.org/FAQs/MacrosVBA/ApplicationEvents.htm
 
G

Greg

I have read both of those articles already and i am still having issues. The
VBA script i have automatically runs when you click on the Envelopes button
in word 2007. I just need that macro to be available to the user when the
program starts. I've noticed that as long as the macro loaded up, it will run
when needed. However, trying to move the script to another machine was the
problem. I put it into the Startup folder and it never ran properly, giving
an error. At that point i tried to modify the script on the new computer and
it would deny me access to do so. It seems the security is screwed up. I
don't know how to change the security for that script so every user's account
will be able to use that macro. I also don't know how to change the settings
for every user to share the same start folder either. any more help?
 
J

Jonathan West

Greg said:
I have read both of those articles already and i am still having issues.
The
VBA script i have automatically runs when you click on the Envelopes
button
in word 2007. I just need that macro to be available to the user when the
program starts. I've noticed that as long as the macro loaded up, it will
run
when needed. However, trying to move the script to another machine was the
problem. I put it into the Startup folder and it never ran properly,
giving
an error. At that point i tried to modify the script on the new computer
and
it would deny me access to do so. It seems the security is screwed up. I
don't know how to change the security for that script so every user's
account
will be able to use that macro. I also don't know how to change the
settings
for every user to share the same start folder either. any more help?

Did you put the macro into a separate template, and put that template in the
startup folder?

If not, do that.

If the macro is being blocked by Security settings, then you may need to
digitally sign the template, and have people accept the certificate. if you
did a full install of Office, you should have a utility available called
"Digital Certificate for VBA projects". Use that to make a certificate, sign
the template with it, and try distributing the template again.
 
G

Graham Mayor

Frankly I wouldn't bother. Why not simply make an envelope template and make
it available to all? You can even download an automated sample from my web
site.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Greg

Ok. is there a way to take a small bit of vba code, and have it available, to
all users, for running when word starts? how can i set that up for 25
computers, on all users accounts including those that haven't been created on
the machine yet? I can lower or change settings for security too if needed.
The small code works as a macro. when you click envelopes it automatically
changes the print settings then pulls up the dialog box (shown below). I
didn't see how to do that from the mvp site. Also, does anyone know how to
change the tray? that doesn't seem to work.

Sub ToolsCreateEnvelope()
' Change Default Printer for Envelope Wizard
' Resets printer settings back when finished

Dim sCurrentPrinter As String
Dim sTray As String
Dim sQuery As String
sCurrentPrinter = ActivePrinter 'Save the current printer
sTray = Options.DefaultTray 'Save the current tray
ActivePrinter = "\\ps-birch\law-clinicletter" 'Set the required envelope
printer
Options.DefaultTray = "Envelope Feeder" 'Set tray used for envelopes
Dialogs(wdDialogToolsCreateEnvelope).Show 'Pop up the envelope dialog
ActivePrinter = sCurrentPrinter 'Restore the original printer
Options.DefaultTray = sTray 'Restore the original tray
End Sub
 
S

Scott

Greg,

I would double-check the printer settings to see what the tray is named
there (ie: "Manual Feed", "Bypass Tray", etc.). Also, you can sometimes get
this info by starting to record a blank macro, manually select the print job
just as you would like it, then stop the recording and look at it in the
editor.

The biggest issue I'm having with this (I'm actually trying the same thing)
- is that when you run this as a macro rather than running the envelope
wizard manually, the delivery address from the Word document is not
automatically inserted when you run the macro. Does anyone know an easy way
to override this?

Selection.Copy
and Selection.Paste

do not work as the macro pauses while the envelope wizard is running.

Any ideas?

Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top