Consulting

Results 1 to 2 of 2

Thread: PowerPoint VBA code needed...

  1. #1

    Question PowerPoint VBA code needed...

    I'm trying to make a skin for Windows with PPT (and it's coming out good) and I need some help. I need a script that will see if the text in one textbox (TextBox1) is equivalrnt to text in another one (TextBox2.Text) if if it is goes to a different slide (Slide1) and if they are not equal it displays a Msgbox. IDK how to cuz i'm a noob.

  2. #2
    Hi PwrPntDude10
    I am new here too, but I can help this. You probably already figured out this in the last month, but here is an example of what you can do.
    [vba]
    Sub ValueTest()
    Dim firstVar As String
    Dim secondVar As String
    firstVar = ActivePresentation.Slides(2).Shapes(1).TextFrame.TextRange.Text
    secondVar = ActivePresentation.Slides(2).Shapes(2).TextFrame.TextRange.Text
    If firstVar = secondVar Then ActivePresentation.Slides(1).Shapes(1).TextFrame.TextRange.Text = firstVar
    End Sub
    [/vba]

    The trick is to find out the names of the shapes where the text is located. To find out the names or rename the shapes you can google VBA PowerPoint naming shapes. Go to the PPTools website (sorry I can't post a link in this forum yet).

    This website also will explain how to use VBA if you need it. If you need any more help let me know. I am hoping someone might help me with my question if I start answering some of the other peoples!

    CrazyPP2007

Posting Permissions

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