Results 1 to 4 of 4

Thread: How to deploy Macro

  1. #1

    Thread Starter
    Hyperactive Member koolprasad2003's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    443

    Question 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

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    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

  3. #3

    Thread Starter
    Hyperactive Member koolprasad2003's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    443

    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

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    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
  •  



Click Here to Expand Forum to Full Width