M
Mike
I've written a number of macros for my group, and I'm trying to
implement a distribution process that is as simple as possible. I'm on
a team of 4 and the other 3 members are not as skilled with Word as I
am, so the easier I make it for everyone, the more likely they are to
actually use these macros I've created. Now, I must inform you that I
am aware that I could create a template and share that, but I had some
problems actually trying to get that to work, so I have no desire to go
that route.
The process that I have in place right now is as follows:
1) I copy all of the code in Visual Basic Editor and paste into a new
document, which is located on a shared drive.
2) My team members all go in and copy everything in the document, open
up VBE and paste everything into their own template (Normal.New
Macros).
The toolbar macros that were already there remain, but the keyboard
shortcuts are wiped clean when the entire code is pasted into VBE.
That initially was a big problem, but I created a macro that will
assign keyboard shortcuts to macros. A sample of that code is as
follows:
KeyBindings.Add KeyCode:=BuildKeyCode(wdKey1, wdKeyAlt),
KeyCategory:=wdKeyCategoryMacro, Command:="Zoom_100"
So here is my goal for making the distribution process easier. I have
decided to create a Word document with 2 big buttons - 1 to update
all the code, and 1 to run the macro that assigns the keyboard
shortcuts. I will send this Word document in an email every time I
update the code and my team members will be able to update their macros
in a matter of seconds.
The second button is no problem, as it's just calling another macro.
The first macro is giving me some issues, though. I've got this much
so far for when the first button is pushed:
Private Sub copymacros_Click()
ChangeFileOpenDirectory "N:\Formsteam\Mike's Macros\"
Documents.Open FileName:="Macros.doc"
Selection.WholeStory
Selection.Copy
ActiveDocument.Close
ShowVisualBasicEditor = True
Selection.WholeStory
Selection.Paste
MsgBox strText & "Your Macros have been updated. Thank you.", 64
End Sub
My problem occurs in the 2 lines "Selection.WholeStory" and
"Selection.Paste" because, as it runs on the Word document, and not
the code in VBE.
Is there anything else I can do to get this to work? Obviously, if
this was running form another macro program, this would not be an issue.
implement a distribution process that is as simple as possible. I'm on
a team of 4 and the other 3 members are not as skilled with Word as I
am, so the easier I make it for everyone, the more likely they are to
actually use these macros I've created. Now, I must inform you that I
am aware that I could create a template and share that, but I had some
problems actually trying to get that to work, so I have no desire to go
that route.
The process that I have in place right now is as follows:
1) I copy all of the code in Visual Basic Editor and paste into a new
document, which is located on a shared drive.
2) My team members all go in and copy everything in the document, open
up VBE and paste everything into their own template (Normal.New
Macros).
The toolbar macros that were already there remain, but the keyboard
shortcuts are wiped clean when the entire code is pasted into VBE.
That initially was a big problem, but I created a macro that will
assign keyboard shortcuts to macros. A sample of that code is as
follows:
KeyBindings.Add KeyCode:=BuildKeyCode(wdKey1, wdKeyAlt),
KeyCategory:=wdKeyCategoryMacro, Command:="Zoom_100"
So here is my goal for making the distribution process easier. I have
decided to create a Word document with 2 big buttons - 1 to update
all the code, and 1 to run the macro that assigns the keyboard
shortcuts. I will send this Word document in an email every time I
update the code and my team members will be able to update their macros
in a matter of seconds.
The second button is no problem, as it's just calling another macro.
The first macro is giving me some issues, though. I've got this much
so far for when the first button is pushed:
Private Sub copymacros_Click()
ChangeFileOpenDirectory "N:\Formsteam\Mike's Macros\"
Documents.Open FileName:="Macros.doc"
Selection.WholeStory
Selection.Copy
ActiveDocument.Close
ShowVisualBasicEditor = True
Selection.WholeStory
Selection.Paste
MsgBox strText & "Your Macros have been updated. Thank you.", 64
End Sub
My problem occurs in the 2 lines "Selection.WholeStory" and
"Selection.Paste" because, as it runs on the Word document, and not
the code in VBE.
Is there anything else I can do to get this to work? Obviously, if
this was running form another macro program, this would not be an issue.