Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Mar 2002
    Location
    Germany, Germany
    Posts
    169
    Thanks
    0
    Thanked 0 Times in 0 Posts

    HasTextFrame property (XP SP3)

    Hello everybody,

    I have some difficulties using the hasTextFrame-property. I want to switch all text fields from one language to another within one presentation. I already found some threads which handle this topic. They all use the .hasTextFrame-property in order to identify whether there is something to switch or not. Now that's what happens when I use it: Imagine you have a presentation that contains just a rectangle without text. If you rightclick the rectangle and choose Format AutoShape from the context menu, the multipage Textfield is disabled. Nevertheless the .hasTextFrame-property of this shape returns msoTrue (=-1) in the directwindow (vba). It dawns to me that every shape that could contain text, delivers true for this property. I would like to distinguish between shapes, where the textfield-multipage is disabled and where it is not. Are there any ideas out there? I am not very used to the PowerPoint object model. Reason for this question is, that my current macro sometimes sets the AutoFit-checkbox for fitting the shape size to the text - which is not what I want to have.
    Any help will be appreciated!

    P.S. is there any literature known, that handles the PowerPoint object model and vba environment, something like "Professional Excel Development" for Excel?

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

    Re: HasTextFrame property (XP SP3)

    I don't know the answer to your question (I find the PowerPoint object model impenetrable), but a lot of info can be found in the Programming PowerPoint section of The PowerPoint FAQ List

  3. #3
    2 Star Lounger
    Join Date
    Mar 2002
    Location
    Germany, Germany
    Posts
    169
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: HasTextFrame property (XP SP3)

    Hello Hans,

    thank you for the resouce, it looks like there is lots of knowledge there. I will see, what I can find out. If I find something there, I will post it here.

  4. #4
    3 Star Lounger
    Join Date
    Feb 2007
    Location
    Durham, Durham, United Kingdom
    Posts
    286
    Thanks
    0
    Thanked 10 Times in 10 Posts

    Re: HasTextFrame property (XP SP3)

    To test for text in a textframe

    First test for the textframe with .hastextframe and then test ".textframe.hastext". You must do both as the second test will crash if the shape doesn't have a textframe.

    If you need to change the spellcheck language you can contact me via PowerPoint Alchemy we have an addin that will do this (free trial) Not tested in 2007

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

    Re: HasTextFrame property (XP SP3)

    Hi John,

    I thought of HasText too, but I don't think it quite does what Porley asked.

    When you create a rectangle from the drawing toolbar, its HasTextFrame property is True and its TextFrame.HasText property is False. The Text Box tab in the Format Text Box dialog is disabled (greyed out) [Porley meant the Text Box tab when (s)he mentioned 'text field-multipage]
    As soon as you enter some text in the rectangle, the TextFrame.HasText property becomes True and the Text Box tab in the dialog becomes enabled.
    When you delete all text from the text box, the TextFrame.HasText property is reset to False again, but the Text Box tab remains enabled. I don't know of a dependable way to test whether the Text Box tab is enabled or not.

  6. #6
    2 Star Lounger
    Join Date
    Mar 2002
    Location
    Germany, Germany
    Posts
    169
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: HasTextFrame property (XP SP3)

    Hello John and Hans,

    thank you for your suggestions. It seems we are on the same track. My problem is that as soon as the Text Box tab is enabled, it occasionally occurs, that the Autofit-checkbox gets enabled which leads to an unwanted change of the shapes size. I would be happy if I could prevent this from happening. I do not mind whether the Text Box tab is enabled or not, but I have to ensure that the shapes keep their size. Is this a known phenomenon?
    If you know a reliable workaround for my problem, I would be happy to learn about it. And sorry for bringing confusion. I am working with a german version of PowerPoint, and my translations are only kind of expectations.
    Oh, by the way, I

  7. #7
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: HasTextFrame property (XP SP3)

    Hi Porley
    I don't know if you've seen this from the help files:
    Set myDocument = ActivePresentation.Slides(1)
    With myDocument.Shapes(1)
    If .TextFrame.TextRange.Characters.Count < 50 Then
    .TextFrame.AutoSize = ppAutoSizeShapeToFitText
    End If
    End With

    PpAutoSize can be one of these PpAutoSize constants.
    ppAutoSizeMixed
    ppAutoSizeNone
    ppAutoSizeShapeToFitText

    I guess you could write something that would loop through the text frames setting autosize to none. However, if your shape has already resized, it will be too late.
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  8. #8
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: HasTextFrame property (XP SP3)

    Hi POrley

    Hopefully I am not barking up the wrong tree but I recently made a tri-lingual 12 page presentation for a pal of mine, English, French and Japanese, all I did was to copy and paste the English slides twice, changed the English text to French and Japanese in the copies and then used country flags as hyperlinks to navigate, i.e. Flag 1, view this presentation in French (regardez cette pr
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

Posting Permissions

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