Consulting

Results 1 to 3 of 3

Thread: text from shape at specific location

  1. #1

    text from shape at specific location

    Hello

    I am trying to do something which i thought would be simple, but cannto work out how to do it.

    I simply want to have a variable which is the text from a slide at a specific location.
    ie Varx = sld.shape(left=50,top=100).text

    Can i somehow select that shape and location (that example above doesnt work) without having to loop through all shapes on the page (thats the only way i currently know how to do it - loop through, and then add if left = x and top = x, then...

    Hope this makes sense.

    Thanks

    Jfish

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    It makes sense but if you use left and top you will have to loop through the shapes. Another problem will be that the slightest move of the shape and it will fail!

    There are several alternatives:

    Try naming the shape (easy in 2007) or in other versions

    [vba]Sub nameme()
    ActiveWindow.Selection.ShapeRange(1).Name = "myshape"
    End Sub[/vba]

    And then:

    [vba]var= ActivePresentation.Slides(xx).Shapes("myshape").TextFrame.TextRange[/vba]
    Last edited by John Wilson; 05-17-2008 at 08:50 AM.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    john - thanks. i will give that a try. i have got the code working but it is taking a little while to run due to the looping method i am currently using, so will try and adapt with your suggestion. cheers

Posting Permissions

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