PC Review


Reply
Thread Tools Rate Thread

Add to this macro

 
 
Annette
Guest
Posts: n/a
 
      5th May 2010
Another user provided this code for creating a text box with font size
8/Arial. However, it is putting in color and a border. Since the recorder
was removed, I can not figure out how to add in no color and outline of text
box in addition, I want the text color black.

I monkeyed with this a bit to get the size correct:

Sub RefTextBox()

Dim myBox As Shape
Set myBox = ActivePresentation.Slides(1).Shapes.AddShape(msoShapeRectangle,
10, 10, 211, 15)
myBox.TextFrame.TextRange.Text = "hello" 'put hello in the box
myBox.TextFrame.TextRange.Font.Size = 8 'make the font size of the box 8

End Sub

Thanks for help you provide.


 
Reply With Quote
 
 
 
 
David Marcovitz
Guest
Posts: n/a
 
      5th May 2010
On 5/5/10 1:55 PM, Annette wrote:
> Sub RefTextBox()
>
> Dim myBox As Shape
> Set myBox = ActivePresentation.Slides(1).Shapes.AddShape(msoShapeRectangle,
> 10, 10, 211, 15)
> myBox.TextFrame.TextRange.Text = "hello" 'put hello in the box
> myBox.TextFrame.TextRange.Font.Size = 8 'make the font size of the box 8
>
> End Sub


Perhaps adding these two lines:

myBox.Fill.Transparency = 1
myBox.Line.Transparency = 1


--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
Reply With Quote
 
Annette
Guest
Posts: n/a
 
      5th May 2010
Worked great and I even figured out how to add, make my text black in color
without further assistance!

Thanks again!


"David Marcovitz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On 5/5/10 1:55 PM, Annette wrote:
>> Sub RefTextBox()
>>
>> Dim myBox As Shape
>> Set myBox =
>> ActivePresentation.Slides(1).Shapes.AddShape(msoShapeRectangle,
>> 10, 10, 211, 15)
>> myBox.TextFrame.TextRange.Text = "hello" 'put hello in the box
>> myBox.TextFrame.TextRange.Font.Size = 8 'make the font size of the box 8
>>
>> End Sub

>
> Perhaps adding these two lines:
>
> myBox.Fill.Transparency = 1
> myBox.Line.Transparency = 1
>
>
> --
> David M. Marcovitz
> Author of _Powerful PowerPoint for Educators_
> http://www.PowerfulPowerPoint.com/
> Microsoft PowerPoint MVP
> Associate Professor, Loyola University Maryland



 
Reply With Quote
 
John Wilson
Guest
Posts: n/a
 
      6th May 2010
Just a point your code is adding a rectangle shape not a textbox which is why
you have a fill and line. Probably (depends on the default set) a textbox
would not show the fill / line.

Sub addtxt()
Dim mytxtbox As Shape
Set mytxtbox = ActivePresentation.Slides(1).Shapes.AddTextbox _
(msoTextOrientationHorizontal, 10, 10, 211, 15)
With mytxtbox.TextFrame.TextRange
..Text = "Hello"
..Font.Size = 8
End With
End Sub
--
john ATSIGN PPTAlchemy.co.uk

Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoi...tutorials.html






"Annette" wrote:

> Another user provided this code for creating a text box with font size
> 8/Arial. However, it is putting in color and a border. Since the recorder
> was removed, I can not figure out how to add in no color and outline of text
> box in addition, I want the text color black.
>
> I monkeyed with this a bit to get the size correct:
>
> Sub RefTextBox()
>
> Dim myBox As Shape
> Set myBox = ActivePresentation.Slides(1).Shapes.AddShape(msoShapeRectangle,
> 10, 10, 211, 15)
> myBox.TextFrame.TextRange.Text = "hello" 'put hello in the box
> myBox.TextFrame.TextRange.Font.Size = 8 'make the font size of the box 8
>
> End Sub
>
> Thanks for help you provide.
>
>
> .
>

 
Reply With Quote
 
David Marcovitz
Guest
Posts: n/a
 
      6th May 2010
That's great! And the second part is even better (that you were able to
figure out more on your own). Next thing you know you'll be answering
other people's questions here.
--David

On 5/5/10 6:23 PM, Annette wrote:
> Worked great and I even figured out how to add, make my text black in color
> without further assistance!
>
> Thanks again!
>
>
> "David Marcovitz"<(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> On 5/5/10 1:55 PM, Annette wrote:
>>> Sub RefTextBox()
>>>
>>> Dim myBox As Shape
>>> Set myBox =
>>> ActivePresentation.Slides(1).Shapes.AddShape(msoShapeRectangle,
>>> 10, 10, 211, 15)
>>> myBox.TextFrame.TextRange.Text = "hello" 'put hello in the box
>>> myBox.TextFrame.TextRange.Font.Size = 8 'make the font size of the box 8
>>>
>>> End Sub

>>
>> Perhaps adding these two lines:
>>
>> myBox.Fill.Transparency = 1
>> myBox.Line.Transparency = 1
>>
>>
>> --
>> David M. Marcovitz
>> Author of _Powerful PowerPoint for Educators_
>> http://www.PowerfulPowerPoint.com/
>> Microsoft PowerPoint MVP
>> Associate Professor, Loyola University Maryland

>
>



--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro recorded... tabs & file names changed, macro hangs Steve Microsoft Excel Worksheet Functions 3 30th Oct 2009 11:41 AM
::: Sort macro with empty lines at the end. ::: Macro de tri avec lignes vide en bas. infojacques@gmail.com Microsoft Excel Discussion 2 5th Jul 2007 11:40 AM
Macro not showing in Tools/Macro/Macros yet show up when I goto VBA editor karll@swfab.com Microsoft Excel Programming 2 30th Mar 2007 07:48 PM
Run Macro On Open event for report and SetValue Macro has wierd error ThompsonJessical@yahoo.com Microsoft Access Macros 2 2nd Aug 2005 05:51 PM
Start Macro / Stop Macro / Restart Macro Pete Microsoft Excel Programming 2 21st Nov 2003 05:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:57 PM.