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 / August 2006

Tip: Looking for answers? Try searching our database.

Creating a textbox during a presentation...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ristmi - 17 Aug 2006 23:35 GMT
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


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.