Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-10-2016, 09:37 AM
Nick70 Nick70 is offline Insert Text with specific Font Size Windows 10 Insert Text with specific Font Size Office 2010 64bit
Novice
Insert Text with specific Font Size
 
Join Date: Jun 2016
Location: London
Posts: 13
Nick70 is on a distinguished road
Default Insert Text with specific Font Size

Hi,

I have a macro that inserts a text ("NEW") in a specific slide (in this case slide 2).


I would now like to amend the font of this text to Font Size 20.

What code should I add to do this?

Current Code

HTML Code:
Sub Textboxnew()
    Dim myTextBox As Shape
    With ActivePresentation.Slides(2)
        Set myTextBox = .Shapes.AddTextbox _
            (Orientation:=msoTextOrientationHorizontal, Left:=450, Top:=20, _
            Width:=100, Height:=100)
        myTextBox.TextFrame.TextRange.Text = "NEW"
        myTextBox.TextFrame.TextRange.Font.Color.RGB = vbRed
    End With
End Sub
Thanks,
Nic

Reply With Quote
  #2  
Old 08-10-2016, 09:56 AM
Nick70 Nick70 is offline Insert Text with specific Font Size Windows 10 Insert Text with specific Font Size Office 2010 64bit
Novice
Insert Text with specific Font Size
 
Join Date: Jun 2016
Location: London
Posts: 13
Nick70 is on a distinguished road
Default

In fact I managed to amend code accordingly

HTML Code:
Sub Textboxnew()
    Dim myTextBox As Shape
    With ActivePresentation.Slides(1)
        Set myTextBox = .Shapes.AddTextbox _
            (Orientation:=msoTextOrientationHorizontal, Left:=450, Top:=20, _
            Width:=100, Height:=100)
        myTextBox.TextFrame.TextRange.Text = "NEW"
        myTextBox.TextFrame.TextRange.Font.Color.RGB = vbRed
        myTextBox.TextFrame.TextRange.Font.Size = 20
    End With
End Sub
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Word - Find Text Font Color - Insert New Text jc491 Word VBA 2 01-04-2016 05:42 PM
Insert Text with specific Font Size Macro to insert multiple pictures to word to a specific size and text wrap mescaL Word VBA 3 11-03-2014 10:51 PM
Insert Text with specific Font Size Deleting all text except text of a certain font size JustAboutNoon Word VBA 3 10-09-2014 10:21 AM
Insert Text with specific Font Size Quickest way to change text to Arial size 11 specific colour BlueClearSky Word 6 11-22-2013 03:34 PM
Insert Text with specific Font Size Font size of track changes balloon text Oryctolagus Word 1 11-13-2013 09:27 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:37 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft