Hi
I have some VBA code for power point that creates a custom drawing (a
chart) during a slideshow presentation. The chart is created using
lines, shapes and textboxes.
First I create a new slide (I'm producing multiple charts) -
Set newSlide =
ActivePresentation.Slides.Add(ActivePresentation.Slides.Count + 1,
ppLayoutBlank)
Then I start building the chart....
For example, I create a new line (for the axis) with the code -
Set newShape = newSlide.Shapes.AddLine(startLeft, startTop, endLeft,
endTop)
For my blocks, I use custom/freeform shapes, for example -
newSlide.Shapes.BuildFreeform(msoEditingAuto, startLeft, startTop)
Then, and here's the problem, I need to create a set of TextBoxes.
During 'Design Time' I use code like -
newSlide.Shapes.AddTextbox(msoTextOrientationHorizontal, 0, 0, 10,
10).Select
With ActiveWindow.Selection
.... code to modify text box
Since I cannot use SELECT during run time (i.e. in the presentation),
what is the alternative?
Thank you
ristmi - 17 Aug 2006 23:44 GMT
Well, there's nothing like posting a question to spur oneself into
action, after all of a few minutes...
All I needed to do was -
set newShape = newSlide.Shapes.AddTextbox(msoTextOrientationHorizontal,
0, 0, 10, 10)
Then I can modify the text of the shape using code such as -
newShape.TextFrame.TextRange..ParagraphFormat.Alignment = ppAlignCenter
etc.
> Hi
>
[quoted text clipped - 27 lines]
>
> Thank you
Echo S - 18 Aug 2006 01:28 GMT
> Well, there's nothing like posting a question to spur oneself into
> action, after all of a few minutes...
Ah, yes. That's called Echo's Law. :-)
http://tinyurl.com/f78cp
> All I needed to do was -
> set newShape = newSlide.Shapes.AddTextbox(msoTextOrientationHorizontal,
[quoted text clipped - 3 lines]
> newShape.TextFrame.TextRange..ParagraphFormat.Alignment = ppAlignCenter
> etc.
Glad you got it worked out!

Signature
Echo [MS PPT MVP] http://www.echosvoice.com
What's new in PPT 2007? http://www.echosvoice.com/2007.htm
Fixing PowerPoint Annoyances http://www.oreilly.com/catalog/powerpointannoy/
PPTLive! Sept 17-20, 2006 http://www.pptlive.com