Consulting

Results 1 to 4 of 4

Thread: Popup box text field then Ok to appear as text box on current slide

  1. #1
    VBAX Contributor
    Joined
    Dec 2018
    Location
    South London
    Posts
    115
    Location

    Popup box text field then Ok to appear as text box on current slide

    Sticker.jpg
    Hi John

    I'm a bit stumped, tried myself, and searched, but no luck.

    I need a Macro that pops up a small text box a person can type into. They click OK and the text is transferred to a bordered text box on that current slide in the top right corner (i.e. word wrapped).

    Any ideas please? Many thanks

  2. #2
    VBAX Contributor
    Joined
    Dec 2018
    Location
    South London
    Posts
    115
    Location
    Sorry, forgot to mention, after the text is typed into the popup box, it then creates the text box with the text included, on the slide.
    Thanks

  3. #3
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    To get that exact layout you would have to create a custom UserForm. You can get a similar effect with a much easier InputBox.

    To get that border you would have to use a single cell table. Here's a start (I'm on holiday from Today)

    Sub Add_Text()
    Dim strText As String
    Dim osld As Slide
    strText = InputBox("Enter Text")
    'NOTE THIS WILL NOT WORK IN SHOW MODE
    Set osld = ActiveWindow.Selection.SlideRange(1)
    With osld.Shapes.AddTable(1, 1)
    With .Table.Cell(1, 1)
    .Shape.Fill.Visible = False
    .Shape.TextFrame.TextRange = strText
    .Shape.TextFrame.TextRange.Font.Color.RGB = vbBlack
    With .Borders(ppBorderTop)
    .Visible = True
    .Weight = 2
    .ForeColor.RGB = vbBlack
    End With
    With .Borders(ppBorderBottom)
    .Visible = True
    .Weight = 2
    .ForeColor.RGB = vbBlack
    End With
    End With
    .Width = 200
    .Left = 10
    .Top = 10
    End With
    End Sub
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  4. #4
    VBAX Contributor
    Joined
    Dec 2018
    Location
    South London
    Posts
    115
    Location
    Thanks John, that's PERFECT !!!
    You star! Have a great vacation

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
  •