Welcome to Windows Help!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

VBA code to set two different font sizes in a textframe

 
   Windows Help (Home) -> Microsoft Powerpoint RSS
Next:  MSConfig Error Message  
Author Message
Dale Fye

External


Since: Nov 26, 2008
Posts: 8



(Msg. 1) Posted: Mon Nov 23, 2009 7:57 am
Post subject: VBA code to set two different font sizes in a textframe
Archived from groups: microsoft>public>office>developer>automation, others (more info?)

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 1Cool.

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

 >> Stay informed about: VBA code to set two different font sizes in a textframe 
Back to top
Login to vote
mcnewsxp

External


Since: Nov 23, 2009
Posts: 1



(Msg. 2) Posted: Mon Nov 23, 2009 8:34 am
Post subject: Re: VBA code to set two different font sizes in a textframe
Archived from groups: per prev. post (more info?)

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 1Cool.
>
> 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

 >> Stay informed about: VBA code to set two different font sizes in a textframe 
Back to top
Login to vote
John Wilson

External


Since: Nov 9, 2008
Posts: 31



(Msg. 3) Posted: Mon Nov 23, 2009 8:37 am
Post subject: RE: VBA code to set two different font sizes in a textframe
Archived from groups: per prev. post (more info?)

Does this work Dale?
With ActivePresentation.Slides(1).Shapes(1).TextFrame.TextRange
..Text = "This is the text" & vbCrLf & "This is the other text"
..Lines(1).Font.Size = 36
..Lines(2).Font.Size = 18
End With
 >> Stay informed about: VBA code to set two different font sizes in a textframe 
Back to top
Login to vote
David Marcovitz

External


Since: Dec 30, 2008
Posts: 25



(Msg. 4) Posted: Mon Nov 23, 2009 11:33 am
Post subject: Re: VBA code to set two different font sizes in a textframe
Archived from groups: per prev. post (more info?)

On 11/23/09 10:57 AM, in article
6A847D01-8C77-4402-B76A-3DBE4D6FC17D.Remove.TakeThisOut@microsoft.com, "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 1Cool.
>
> 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
>

Off the top of my head, it would be something like:

OShape.TextFrame.TextRange.Paragraphs(2).Font.Size = 18
OShape.TextFrame.TextRange.Paragraphs(1).Font.Size = 36

I seem to recall that this can be a bit tricky in that sometimes changing
the last line affects other lines (which is why I did the last line first),
but I might be remembering.

--David
 >> Stay informed about: VBA code to set two different font sizes in a textframe 
Back to top
Login to vote
Dale Fye

External


Since: Nov 26, 2008
Posts: 8



(Msg. 5) Posted: Mon Nov 23, 2009 12:22 pm
Post subject: RE: VBA code to set two different font sizes in a textframe
Archived from groups: per prev. post (more info?)

Thanks, John.

Worked like a charm.

----
Dale



"John Wilson" wrote:

> Does this work Dale?
> With ActivePresentation.Slides(1).Shapes(1).TextFrame.TextRange
> .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
> [URL="http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html"]http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html[/URL]
>
>
>
>
>
>
> "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 1Cool.
> >
> > 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
> >
 >> Stay informed about: VBA code to set two different font sizes in a textframe 
Back to top
Login to vote
Steve Rindsberg

External


Since: Nov 8, 2008
Posts: 108



(Msg. 6) Posted: Mon Nov 23, 2009 2:58 pm
Post subject: Re: VBA code to set two different font sizes in a textframe
Archived from groups: per prev. post (more info?)

In article wrote:
> > I'm using Access VBA to build a series of data driven slides, and want th
> e
> > 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 1Cool.
> >
> > 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

That's technically correct but not relevant.

You can set the text font properties for a textframe.textrange to change all
of the text in the textframe, but you can also change the font properties of
each *character* in a text frame's text if you like.
 >> Stay informed about: VBA code to set two different font sizes in a textframe 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
different PPT slides printing in different sizes - Hello, I have a 10-slide PPT deck (file). I'd like most of the slides to print on 8-1/2" x 11" paper, and two slides in the middle to print on 8" x 14" as their showing a timeline and I want more space. Is it possible to change the...

Help writing this code correctly - I need some help writing this code correctly. I want it to check each If statment but it obviously stops after the first. How can I correctly write this so all of them are ran? I'd like it to work as follows: If the first If statement is true then...

GIF Animations: PPT 2000 vs 2003 - I have a fairly complex animated GIF file which works fine when added to a presentation using PPT 2003. It also works fine when viewed with the 2007 PPT Viewer. When viewed with PPT 2000, or added to a presentation using 2000, it shows the first few..

Automatic Viewing - Is there a way that I can make my presentation continue to play without me clicking on it. Is there an auto view set up or something.

Side-by-side of different slide presentations - I have 4 slide presentations I need to place in a matrix of sorts that would show all four, or at least two, side-by-side. Can anyone help?
   Windows Help (Home) -> Microsoft Powerpoint All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]