Consulting

Results 1 to 6 of 6

Thread: Creating a Find and Replace Macro with an Imput field

  1. #1
    VBAX Newbie
    Joined
    Mar 2014
    Posts
    5
    Location

    Creating a Find and Replace Macro with an Imput field

    I'm creating a presetnation template which contains several fields that need to be customized every time the template is used to create a new presentation. The fields looks like this:

    $yyyy
    $Name
    $Month
    $Day

    These fields are scatterred throughout the template. They are sometimes found in the middle of paragraphs and as individual text boxes. I need a script that would prompt users to enter the following:

    Year in yyyy format :
    Your Name :
    Current Month :
    Current Day :

    Once a user enters all the fields, the script should find the $promps throught the presentation and replace them with the data imput by the user.

    Any help in this regard would be greatly appreciated!
    Thanks in advance

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    The code would not be too difficult but templates with macros are really not a good idea in PowerPoint. Do you really want your user to have code in every presentation?
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Newbie
    Joined
    Mar 2014
    Posts
    5
    Location
    I was thinking that the code would sit in a seperate presentation that would link to the template. Is there a better way?

  4. #4
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    I don't think the average user would open the code presentaion every time they made a presentation. The only sensible solution would be to have the code in a ppam AddIn that creates a ribbon button.

    Click the button and a form to input the data pops up.

    You would need to understand how to use XML to make the button and vba to do the replace.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  5. #5
    VBAX Newbie
    Joined
    Mar 2014
    Posts
    5
    Location
    John,
    Thanks for your insight. I was also thinking alternatively, the imput could come from an Access database to avoid double entry.. Do you think it would be possible to create such a link? Could you point me in the direction of some examples? Or perhaps just the find and replace feature using vba...Really appreciate the help

  6. #6
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    Not really, a ppam is definitely the way to go. I have adapted some code we already had to show you. Open your file with the fields you mention and then doublr click on the ppam file (see download). You should see a new button in the Home Tab.

    DOWNLOAD

    You are welcome to use "as is" or do your own modification but if you need more or an installer to permanantly load the ppam there would be a bill!
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Posting Permissions

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