A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Powerpoint, Publisher and Visio » Powerpoint
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Add to this macro



 
 
Thread Tools Display Modes
  #1  
Old May 5th, 2010, 06:55 PM posted to microsoft.public.powerpoint
Annette[_6_]
external usenet poster
 
Posts: 11
Default Add to this macro

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(msoSh apeRectangle,
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.


  #2  
Old May 5th, 2010, 07:13 PM posted to microsoft.public.powerpoint
David Marcovitz[_2_]
external usenet poster
 
Posts: 130
Default Add to this macro

On 5/5/10 1:55 PM, Annette wrote:
Sub RefTextBox()

Dim myBox As Shape
Set myBox = ActivePresentation.Slides(1).Shapes.AddShape(msoSh apeRectangle,
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
  #3  
Old May 5th, 2010, 11:23 PM posted to microsoft.public.powerpoint
Annette[_6_]
external usenet poster
 
Posts: 11
Default Add to this macro

Worked great and I even figured out how to add, make my text black in color
without further assistance!

Thanks again!


"David Marcovitz" wrote in message
...
On 5/5/10 1:55 PM, Annette wrote:
Sub RefTextBox()

Dim myBox As Shape
Set myBox =
ActivePresentation.Slides(1).Shapes.AddShape(msoSh apeRectangle,
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



  #4  
Old May 6th, 2010, 12:53 PM posted to microsoft.public.powerpoint
John Wilson
external usenet poster
 
Posts: 6,023
Default Add to this macro

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(msoSh apeRectangle,
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.


.

  #5  
Old May 6th, 2010, 01:21 PM posted to microsoft.public.powerpoint
David Marcovitz[_2_]
external usenet poster
 
Posts: 130
Default Add to this macro

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 wrote in message
...
On 5/5/10 1:55 PM, Annette wrote:
Sub RefTextBox()

Dim myBox As Shape
Set myBox =
ActivePresentation.Slides(1).Shapes.AddShape(msoSh apeRectangle,
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
 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:17 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.