|
-
Jun 16th, 2015, 07:51 AM
#1
Thread Starter
Hyperactive Member
How to deploy Macro
I have used Custom Fields in my DOCX file and update them using OpenXML, but custom fields are not getting updated in document.
So I have write following macro to update field, it run well on my machine, Now i want to deploy it on each machine at client side, the machine count is 500 I can not go on each machine and paste macro code in each normal.dot file
what is easy step to do it ? Or when I open word file, will application ask for installing macro ? like addin ?
How to do it please help
Here is my macro
Code:
Private Sub Document_Open()
Dim aStory As Range
Dim aField As Field
For Each aStory In ActiveDocument.StoryRanges
For Each aField In aStory.Fields
aField.Update
Next aField
Next aStory
End Sub
Thanks in advanced for help
MCP, MCTS, Microsoft MVP [Asp.Net/IIS]
For more .NET development tips visit .NET Tips
If the post is useful then please  Rate it
-
Jun 16th, 2015, 04:18 PM
#2
Re: How to deploy Macro
any code will only work for users with appropriate macro security level
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Jun 18th, 2015, 12:33 AM
#3
Thread Starter
Hyperactive Member
Re: How to deploy Macro
Thanks for reply.
But what step do I need to follow to deploy macro on each machine ?
MCP, MCTS, Microsoft MVP [Asp.Net/IIS]
For more .NET development tips visit .NET Tips
If the post is useful then please  Rate it
-
Jun 18th, 2015, 05:36 AM
#4
Re: How to deploy Macro
the normal method is to use an addin
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|