Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Location
    Burpengary, Queensland, Australia
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macros required (Word and Powerpoint (2000/2002/2003))

    Hi there gurus,

    I have a few issues which I really need help with:-

    1. Powerpoint
    My client has approximately 150 Powerpoint presentations that they regularly use. They have just gone through and manually updated each presentation to cater for a new "brand". Further changes are now required and they would like me to write them a macro which does the attaching of the new master template to each of their presentations. I have basically no familiarity with Powerpoint VBA so thought I would ask here first prior to any other course of action.

    2. Word
    I have an autoexec macro which updates/recreates the client specific styles in Word. I would like to amend this macro and add it to the toolbar so that the client can also run it manually when required. However, the autoexec is in the client's Normal.dot file and all their styles and toolbars are contained in a separate styles template.

    Question: Can I link the toolbar button in the styles.dot file to the autoexec macro in Word or do I need to duplicate the macro?

    3. Word
    I would like to be able to run a macro (once only) over approximately 200 templates without having to do same manually. Could someone please point me to some code which will achieve this for me? I realise that I will need to tweak the templates manually after but most of the stuff I want to do can be automated. This macro will then be amended to "current document only" and added to the toolbar in the styles document for updating of old documents which the client may need to do manually.

    Any assistance you could give would be helpful.

    Thanks very much

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Macros required (Word and Powerpoint (2000/2002/2003))

    Regarding #2, it seems easiest to have a single macro for this operation (e.g., StyleUpdate) that you can call from your AutoExec procedure or anywhere else. Then the users can call the regular macro directly and you will have the freedom to add other functionality to the AutoExec if needed in the future.

    You can run a macro in Normal.dot from any context, but you might have to use Application.Run. Of course, it is essential that the macro have the correct source and destination information before copying, and if the context change creates too much complexity, duplicating the macro would be easiest.

    Regarding #3, there are many threads here about opening multiple documents. Templates have some differences, of course, but a little searching here might supply most of the solution.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macros required (Word and Powerpoint (2000/2002/2003))

    In addition to Jefferson's remark about #3, see for example <post:=591,926>post 591,926</post:>, <post:=595,947>post 595,947</post:> and <post:=648,451>post 648,451</post:>.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macros required (Word and Powerpoint (2000/2002/2003))

    Here's a sample PowerPoint macro that you might use as starting point:

    Sub FixTemplate()
    ' Modify as needed, but keep trailing backslash
    Const strPath = "C:Presentations"
    Const strTemplate = "C:CorporateTemplate.pot"
    Dim strFile As String
    Dim prs As Presentation
    strFile = Dir(strPath & "*.ppt")
    Do While Not strFile = ""
    Set prs = Presentations.Open(FileName:=strPath & strFile, WithWindow:=False)
    prs.ApplyTemplate FileName:=strTemplate
    prs.Save
    prs.Close
    strFile = Dir
    Loop
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •