Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / April 2007

Tip: Looking for answers? Try searching our database.

PowerPoint VBA and WordArt

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bl - 30 Apr 2007 01:52 GMT
I need to use VBA to add a WordArt shape and I want the WordArt shape to
always be centered horizontally but be in a specific location vertically.
What is the calculation or means to figure this out based on the number of
characters in the text that will be displayed in the WordArt shape?
Thanks!!!
Steve Rindsberg - 30 Apr 2007 03:50 GMT
> I need to use VBA to add a WordArt shape and I want the WordArt shape to
> always be centered horizontally but be in a specific location vertically.
> What is the calculation or means to figure this out based on the number of
> characters in the text that will be displayed in the WordArt shape?

I don't think that'll work.  Most fonts are proportional, meaning that e.g a
"w" is considerably wider than an "i".  You'd need the width information for
each character in the font and that's just the beginning of the complications.  
Different WordArt shapes may distort the text, which'd throw your calculations
off, even if you did have all the width information.  Then there's kerning ...

But if you're adding word via code, you can get a reference to the shape and
easily find out its height and width properties.

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
bl - 30 Apr 2007 14:56 GMT
Good morning Steve,

Makes sense.....

Okay, let me work through this.....

I could still have my wordart place holders already setup in the slide.
Then, part of my coding of updating those place holders I would add new
wordart with the updated with "new" text and capture the settings....correct?
If so, what's a good way of capturing that information?

Anytime that you add a new wordart item does it always center on the slide
vertically and horizontally?

Thanks!!
bl

> > I need to use VBA to add a WordArt shape and I want the WordArt shape to
> > always be centered horizontally but be in a specific location vertically.
[quoted text clipped - 15 lines]
> PPTools:  www.pptools.com
> ================================================
Steve Rindsberg - 30 Apr 2007 19:27 GMT
> Good morning Steve,
>
[quoted text clipped - 6 lines]
> wordart with the updated with "new" text and capture the settings....correct?
> If so, what's a good way of capturing that information?

Quote the code you use to add the word art and we'll go from there with specific
changes that suit the method you're using.

> Anytime that you add a new wordart item does it always center on the slide
> vertically and horizontally?

It seems to but I use it so seldom that if I were you, I wouldn't act on my advice.
<g>

Beside, you mentioned putting it placeholders ... if you do that, it'll appear
wherever the placeholder is.

> Thanks!!
> bl
[quoted text clipped - 18 lines]
> > PPTools:  www.pptools.com
> > ================================================

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
David M. Marcovitz - 30 Apr 2007 15:12 GMT
What Steve said and ...

If you are working in Normal/Edit view, you can use something like this
to add the WordArt and then align it center. The msoTrue parameter in the
Align method indicates that the alignment will be relative to a slide.

   ActiveWindow.Selection.SlideRange.Shapes.AddTextEffect _
       (msoTextEffect10, "Testing 1 2 3", "Arial Black", 36#, _
       msoFalse, msoFalse, 5, 5).Select
   ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, msoTrue

--David
Signature

David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/

> I need to use VBA to add a WordArt shape and I want the WordArt shape
> to always be centered horizontally but be in a specific location
> vertically. What is the calculation or means to figure this out based
> on the number of characters in the text that will be displayed in the
> WordArt shape? Thanks!!!
bl - 30 Apr 2007 17:16 GMT
Hello David...

To give a little more information..... all my placeholders are rotated 90
degrees. Why? I am using the new Dell flat wide screen monitors that rotate
but my video card does not support the rotation. Thus, I having to create a
slide that is 90 degrees. Currently I am using text boxes but I can't format
the text like need to do that Word Art offers.

Is there a better way?

Thanks!
bl

> What Steve said and ...
>
[quoted text clipped - 14 lines]
> > on the number of characters in the text that will be displayed in the
> > WordArt shape? Thanks!!!
David M. Marcovitz - 30 Apr 2007 18:02 GMT
I'm not sure I have anything to offer you. Perhaps, someone else has some
ideas.
--David

Signature

David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/

> Hello David...
>
[quoted text clipped - 29 lines]
>> > this out based on the number of characters in the text that will be
>> > displayed in the WordArt shape? Thanks!!!
Austin Myers - 30 Apr 2007 18:55 GMT
You may use a regular text for this, if it's in an object.  An Example:

This example adds an oval containing text to slide one in the active
presentation and rotates the oval and the text 45 degrees. The parent object
for the text frame is the Shape object that contains the text.

Set myShapes = ActivePresentation.Slides(1).Shapes
With myShapes.AddShape(Type:=msoShapeOval, Left:=50, _
       Top:=50, Width:=300, Height:=150).TextFrame
   .TextRange.Text = "Test text"
   .Parent.Rotation = 45
End With

Austin Myers
MS PowerPoint MVP Team

Provider of PFCPro, PFCMedia and PFCExpress
www.playsforcertain.com

> Hello David...
>
[quoted text clipped - 30 lines]
>> > on the number of characters in the text that will be displayed in the
>> > WordArt shape? Thanks!!!
bl - 30 Apr 2007 19:32 GMT
Thanks Austin,

That is currently what I am doing now. I kinda want my cake and eat too....
Meaning, I want and like the functionality of a text box but want to format
my fonts like the wordart. Thus, the text boxes span the width of the slide
and I have my text centered inside. Of course with the good ol' wordart it
wants to fill the entire area with my text making look distorted and not
consistant.

With that being said...... would you think it would be possible to have the
wordart placeholders filled with spaces and then when the code runs it would
determine the length of the text and add spaces to left and right to keep the
text a consistant size and centered?

Thanks for listening!

bl

> You may use a regular text for this, if it's in an object.  An Example:
>
[quoted text clipped - 49 lines]
> >> > on the number of characters in the text that will be displayed in the
> >> > WordArt shape? Thanks!!!

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.