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  

VBA code to set two different font sizes in a textframe



 
 
Thread Tools Display Modes
  #1  
Old November 23rd, 2009, 03:57 PM posted to microsoft.public.office.developer.automation,microsoft.public.powerpoint
Dale Fye
external usenet poster
 
Posts: 2,651
Default VBA code to set two different font sizes in a textframe

I'm using Access VBA to build a series of data driven slides, and want the
Title in one of the slides to contain a line of text that has font.size = 36,
and the font.size on the following like to 18).

The code I'm using right now looks like:
oShape.TextFrame.TextRange.Font.Size = 36
oShape.TextFrame.TextRange = "First Line" & vbcrlf & "Second line"

How can I modify this code to accomplish my goal?

----
Dale

  #3  
Old November 23rd, 2009, 04:34 PM posted to microsoft.public.office.developer.automation,microsoft.public.powerpoint
mcnewsxp
external usenet poster
 
Posts: 83
Default VBA code to set two different font sizes in a textframe

On Nov 23, 10:57*am, Dale Fye wrote:
I'm using Access VBA to build a series of data driven slides, and want the
Title in one of the slides to contain a line of text that has font.size = 36,
and the font.size on the following like to 18).

The code I'm using right now looks like:
oShape.TextFrame.TextRange.Font.Size = 36
oShape.TextFrame.TextRange = "First Line" & vbcrlf & "Second line"

How can I modify this code to accomplish my goal?

----
Dale


each textframe has only one fint.size property per rendering
  #4  
Old November 23rd, 2009, 04:37 PM posted to microsoft.public.office.developer.automation,microsoft.public.powerpoint
John Wilson
external usenet poster
 
Posts: 6,023
Default VBA code to set two different font sizes in a textframe

Does this work Dale?
With ActivePresentation.Slides(1).Shapes(1).TextFrame.T extRange
..Text = "This is the text" & vbCrLf & "This is the other text"
..Lines(1).Font.Size = 36
..Lines(2).Font.Size = 18
End With
--
john ATSIGN PPTAlchemy.co.uk

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






"Dale Fye" wrote:

I'm using Access VBA to build a series of data driven slides, and want the
Title in one of the slides to contain a line of text that has font.size = 36,
and the font.size on the following like to 18).

The code I'm using right now looks like:
oShape.TextFrame.TextRange.Font.Size = 36
oShape.TextFrame.TextRange = "First Line" & vbcrlf & "Second line"

How can I modify this code to accomplish my goal?

----
Dale

  #6  
Old November 23rd, 2009, 08:22 PM posted to microsoft.public.office.developer.automation,microsoft.public.powerpoint
Dale Fye
external usenet poster
 
Posts: 2,651
Default VBA code to set two different font sizes in a textframe

Thanks, John.

Worked like a charm.

----
Dale



"John Wilson" wrote:

Does this work Dale?
With ActivePresentation.Slides(1).Shapes(1).TextFrame.T extRange
.Text = "This is the text" & vbCrLf & "This is the other text"
.Lines(1).Font.Size = 36
.Lines(2).Font.Size = 18
End With
--
john ATSIGN PPTAlchemy.co.uk

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






"Dale Fye" wrote:

I'm using Access VBA to build a series of data driven slides, and want the
Title in one of the slides to contain a line of text that has font.size = 36,
and the font.size on the following like to 18).

The code I'm using right now looks like:
oShape.TextFrame.TextRange.Font.Size = 36
oShape.TextFrame.TextRange = "First Line" & vbcrlf & "Second line"

How can I modify this code to accomplish my goal?

----
Dale

 




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 02:15 AM.


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