Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Edinburgh, Midlothian, Scotland
    Posts
    492
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Random text quotes (Office 2003)

    Hi

    I am wondering if I can find a way to call in random quotes from Access (or a basic text file) and place them (and hopefully animate them). Basically I want an intro to my presentation which will play while the audience is waiting for the main session to start. It would ideally play each quote for say 10 seconds at a time.

    Thanks

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

    Re: Random text quotes (Office 2003)

    In a fit of masochism, I tried to wrestle PowerPoints bizarre object model to write a macro for this, but I wasn't able to obtain consistent results. Although the macro more or less did what you want, it would quit without any warning or error message.

    You might be better off preparing a presentation with a separate slide for each quote. The macro in the presentation in the zip file will create a presentation from a text file with quotes (one line = one quote).

    Tushar Mehta has a free add-in that will show a presentation in random order: Random Slide Show.

  3. #3
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Edinburgh, Midlothian, Scotland
    Posts
    492
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Random text quotes (Office 2003)

    Hans

    Thanks for your interest and efforts.

    I really was not expecting anyone to spend their time on this (but I do understand the challenge).

    I've downloaded your zip file (and Tushar Mehta's add-in) and I'll have a play tonight.

    A very very very big thanks for your help.

    Colin

  4. #4
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Edinburgh, Midlothian, Scotland
    Posts
    492
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Random text quotes (Office 2003)

    Hans many thanks again.

    I'm assuming you meant you had had probs with the macro itself exiting rather than with the new presentation which is created. I've run the macro 20 times or so now without a problem.

    To test it further, I took my database which has almost 230 quotes in it (don't worry, I was only going to use a random 20 to 30 at a time) exported to text, then copied and pasted so it had almost 1000 lines and tested it with that. It hasn't failed yet. So it looks fine so far. (interestingly, 2 of the three quotes you used were also well up in my list).

    I haven't looked at the slide randomising add-in yet as (for now) I can cope with randomising when selecting from Access.

    Can I ask for one more bit of help now. I was trying to create a second box to show the person the quote is credited to, but can't make it work. The reason I didn't simply use

    strQuote1 + " - " + strQuote2 was because I wanted to change the font and make it smaller and italic if possible.

    I put a string handling line in to break the initial text string into component parts, (I used a "QQQ" when exporting from access to identify the field end. I had then hoped to simply add another text box inside the "with" command as follows

    Line Input #f, strQuote
    strQuote1 = Left(strQuote, InStr(strQuote, "QQQ") - 1)
    strQuote2 = Mid(strQuote, InStr(strQuote, "QQQ") + 3)

    With prs.Slides.Add(i, ppLayoutBlank).Shapes.AddTextbox _
    (msoTextOrientationHorizontal, 72, 72, w - 144, h - 144). _TextFrame.TextRange
    .ParagraphFormat.Alignment = ppAlignCenter
    .Text = strQuote1
    .Font.Size = 36
    .AddTextbox(msoTextOrientationHorizontal, 72, 102, w - 144, h - 144). _
    TextFrame.TextRange
    .ParagraphFormat.Alignment = ppAlignCenter
    .Text = strQuote2
    .Font.Size = 20
    End With

    I keep getting a "Method not found" error when it comes to MY .AddTextbox however. I also tried a second With statement but this simply added an extra slide for each author, so my full export of 225 lines ended up creating 450 slides.

    Colin

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

    Re: Random text quotes (Office 2003)

    You have to organize the code slightly differently, since you cannot nest the creation of one shape in that of the other one:

    Line Input #f, strQuote
    strQuote1 = Left(strQuote, InStr(strQuote, "QQQ") - 1)
    strQuote2 = Mid(strQuote, InStr(strQuote, "QQQ") + 3)
    With prs.Slides.Add(i, ppLayoutBlank)
    With .Shapes.AddTextbox _
    (msoTextOrientationHorizontal, 72, 72, w - 144, h / 2 - 144) _
    .TextFrame.TextRange
    .ParagraphFormat.Alignment = ppAlignCenter
    .Text = strQuote1
    .Font.Size = 36
    End With
    With .Shapes.AddTextbox _
    (msoTextOrientationHorizontal, 72, h / 2 + 72, w - 144, h / 2 - 144) _
    .TextFrame.TextRange
    .ParagraphFormat.Alignment = ppAlignCenter
    .Text = strQuote2
    .Font.Size = 24
    .Font.Italic = msoTrue
    End With
    End With

  6. #6
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Edinburgh, Midlothian, Scotland
    Posts
    492
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Random text quotes (Office 2003)

    Hans

    Thanks again.

    Works perfectly.

    Colin

Posting Permissions

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