Group:  Other Microsoft Office Products ยป microsoft.public.powerpoint
Thread: Change font on selected text

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Change font on selected text
"Elmar" <emelec[ at ]austarnet.com.au> 20.09.2006 00:18:15
I've recorded a macro converting selected text to superscript. This
works fine, as long as the desired changes are always in the same
relative position on a slide. How should I change the macro that the
current text selection is being dealt with rather than the recorded
one? In other words, how can the "Start" and "Length" values reflect
the current selection?

Thanks in advance

Elmar


Sub SupNormal()
'
' Macro recorded 20.09.2006 by Elmar von Muralt
'


ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=122,
Length:=3).Select
With ActiveWindow.Selection.TextRange.Font
.Name = "Arial"
.Size = 32
.Bold = msoFalse
.Italic = msoFalse
.Underline = msoFalse
.Shadow = msoFalse
.Emboss = msoFalse
.BaselineOffset = 0.3
.AutoRotateNumbers = msoFalse
.Color.SchemeColor = ppForeground
End With
End Sub

Re: Change font on selected text
"Shyam Pillai" <ShyamPillai[ at ]Gmail.com> 20.09.2006 02:11:49
Elmar,

Delete the following line:
[Quoted Text]
> ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=122,
> Length:=3).Select
The rest will work only on the active text selection.


--
Regards,
Shyam Pillai

Image Importer Wizard
http://skp.mvps.org/iiw.htm


"Elmar" <emelec[ at ]austarnet.com.au> wrote in message
news:1158711495.236830.171450[ at ]m7g2000cwm.googlegroups.com...
> I've recorded a macro converting selected text to superscript. This
> works fine, as long as the desired changes are always in the same
> relative position on a slide. How should I change the macro that the
> current text selection is being dealt with rather than the recorded
> one? In other words, how can the "Start" and "Length" values reflect
> the current selection?
>
> Thanks in advance
>
> Elmar
>
>
> Sub SupNormal()
> '
> ' Macro recorded 20.09.2006 by Elmar von Muralt
> '
>
>
> ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=122,
> Length:=3).Select
> With ActiveWindow.Selection.TextRange.Font
> .Name = "Arial"
> .Size = 32
> .Bold = msoFalse
> .Italic = msoFalse
> .Underline = msoFalse
> .Shadow = msoFalse
> .Emboss = msoFalse
> .BaselineOffset = 0.3
> .AutoRotateNumbers = msoFalse
> .Color.SchemeColor = ppForeground
> End With
> End Sub
>


Re: Change font on selected text
"Elmar" <emelec[ at ]austarnet.com.au> 20.09.2006 02:24:33
Thankyou very much Shyam,

It works like a charm :o)

Kind regards

Elmar

Shyam Pillai wrote:
[Quoted Text]
> Elmar,
>
> Delete the following line:
> > ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=122,
> > Length:=3).Select
> The rest will work only on the active text selection.
>
>
> --
> Regards,
> Shyam Pillai
>
> Image Importer Wizard
> http://skp.mvps.org/iiw.htm
>
>
> "Elmar" <emelec[ at ]austarnet.com.au> wrote in message
> news:1158711495.236830.171450[ at ]m7g2000cwm.googlegroups.com...
> > I've recorded a macro converting selected text to superscript. This
> > works fine, as long as the desired changes are always in the same
> > relative position on a slide. How should I change the macro that the
> > current text selection is being dealt with rather than the recorded
> > one? In other words, how can the "Start" and "Length" values reflect
> > the current selection?
> >
> > Thanks in advance
> >
> > Elmar
> >
> >
> > Sub SupNormal()
> > '
> > ' Macro recorded 20.09.2006 by Elmar von Muralt
> > '
> >
> >
> > ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=122,
> > Length:=3).Select
> > With ActiveWindow.Selection.TextRange.Font
> > .Name = "Arial"
> > .Size = 32
> > .Bold = msoFalse
> > .Italic = msoFalse
> > .Underline = msoFalse
> > .Shadow = msoFalse
> > .Emboss = msoFalse
> > .BaselineOffset = 0.3
> > .AutoRotateNumbers = msoFalse
> > .Color.SchemeColor = ppForeground
> > End With
> > End Sub
> >

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net