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

0
Utf
11/23/2009 3:57:03 PM
powerpoint 2011 articles. 0 followers. Follow

5 Replies
5229 Views

Similar Articles

[PageSpeed] 18

On 11/23/09 10:57 AM, in article
6A847D01-8C77-4402-B76A-3DBE4D6FC17D@microsoft.com, "Dale Fye"
<dale.fye@nospam.com> 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
> 

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
-- 
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland


0
David
11/23/2009 4:33:35 PM
On Nov 23, 10:57=A0am, Dale Fye <dale....@nospam.com> 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 =
=3D 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 =3D 36
> oShape.TextFrame.TextRange =3D "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
0
mcnewsxp
11/23/2009 4:34:10 PM
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
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_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
> 
0
Utf
11/23/2009 4:37:01 PM
In article <4ce6fac8-dd55-43d9-be28-
e98caac76e3d@h10g2000vbm.googlegroups.com>, Mcnewsxp wrote:
> On Nov 23, 10:57 am, Dale Fye <dale....@nospam.com> 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 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

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.





0
Steve
11/23/2009 7:58:39 PM
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
> http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_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
> > 
0
Utf
11/23/2009 8:22:01 PM
Reply:

Similar Artilces:

How to Use One PST file on Two Computers?
Hello: I have a desktop machine with a pst file in my Outlook 2003. I would like to copy this pst file to my laptop. How do I synchronize the same file on 2 machines so I won't get duplicate e-mails? I use one premium Yahoo e-mail account and several free Yahoo accounts with YahooPOPs.. Thanks in advance, Spudy Hi Spudy, it is not possible by default to share PST files. A list of a list of third-party synctools are also on this site: http://www.slipstick.com/outlook/sync.htm On the Microsoft Office Marketplace site is a list of third-party messaging tools: http://office.microsoft.com...

Payout reason codes
Can someone point me to where in the database the payout reason codes are stored? thanks, Store Ops Manager, Database, Reason Codes, Type = Payout "Jason" wrote: > Can someone point me to where in the database the payout reason codes are > stored? > > thanks, Thanks. What I meant (and asked poorly) was if I wanted to design a custom report to show that info where would I need to look? Thanks, "Wendy_I" wrote: > Store Ops Manager, Database, Reason Codes, Type = Payout > > > > "Jason" wrote: > > > Can someo...

OLE notes
Is there somewhere where I can set a preference on where OLE notes are stored for a company using GP 9. Right now, by default, the notes are stored in a folder on the desktop of Windows Servers 2003. Since I have multiple companies running, this is rather untidy. :-) More importantly, because of backup considerations, I want to set the default path to a location in the programs directory. To determine where OLE Notes are stored in Microsoft Dynamics GP, follow these steps: 1. Locate the dex.ini file in the folder where Microsoft Dynamics GP is installed. 2. Double-click the dex.ini f...

Need to set extra hard return
Hi, This must be a very basic thing, but I have been asked to submit a paper with extra hard returns in Word. How do I do this? Can anyone help me out please? Thanks. Viju vijuhegde wrote: > This must be a very basic thing, but I have been asked to submit a > paper with extra hard returns in Word. How do I do this? Can anyone > help me out please? Ask whomever assigned this task to explain this task. Essentially a "hard return" signifies the end of a paragraph. It's simply pressing ENTER. The "soft return" is just a way to start a new line - h...

How to Stop Worksheet_Change event from running during code execution
I'm sorry If I've asked this before but I can't find an answer to it. I have the following 2 events in a worksheet module.... Private Sub Worksheet_Change(ByVal Target As Excel.Range) Private Sub Worksheet_SelectionChange(ByVal Target As Range) I run some codes, either in UserForms or general procedures that make changes to this worksheet. Q. Is there a way to by-pass those two events somehow? As an example I have a uf that comes up if a cell is selected in that sheet. So I need those worksheet_Change events to work at that point. But then, the uf does some stuff like inputing ...

VBA code to say Yes or No if any VBA code is present in ActiveWork
Using XL 2003 & 97 Would like hit Ctrl+Shift+V and have an answer either yes or no as to the presence of Any VBA code in the Active Workbook. I do know that about the VBA editor/Explorer or to press the Run Macro button and get a list from various sources . I would like to stay at the keyboard and process a series of macros including one to let me know if I even need to evoke the VBA explorer. TIA Dennis There is no bootstrap macro to tell you whether you have macros or not. If there were there would be no limit to virus writers. --- HTH, David McRitchie, Microsoft MVP - Excel ...

Sort several workbooks using code
I am looking to run code that will sort several workbooks even when they are closed. The code would be executed via a master workbook which will also be sorted. Is this possible? I'm not aware of sorting records in a CLOSED workbook, but what you can do is this. Create some button on the master workbook and let it open the other workbook, sort the other workbook and close the other workbook. Accompanied with Application.ScreenUpdating (but also depending on the amount of records) you will hardly notice the sorting actions. Does this help ? -- Regards; Mark ...

BROWSEINFO: set (pre)selected path
Hi together, in C++.net I can do the following in a FolderBrowserDialog for the user to change f.e. the workPath for an application: FolderBrowserDialog* di=new FolderBrowserDialog(); di->RootFolder = Environment::SpecialFolder::Desktop; di->SelectedPath=workPath; In an MFC project I can do the following: BROWSEINFO bi; bi.pidlRoot = NULL; // set root to user's desktop But I did not find any possibily to pre(select) the old workPath in then structure: typedef struct _browseinfo { HWND hwndOwner; LPCITEMIDLIST pidlRoot; LPTSTR pszDisplayName; LPCTSTR lpszTi...

Maintain Aspect Ratio of 2D Plot on Different Monitors ?? #2
Hello; There's a good chance that some might have already posted this question (including myself!), but I couldn't find any related threads in this forum directly addressing the problem. Suppose you've a 2D chart displaying the fuselage of an airplane nicely proportional on the Full Screen of your desktop monitor. You copy the w/b to your laptop (with the same XL 2003) and the display is completely out of proportion because of the different aspect ratio of the screen. Q1: Instead of Full Screen display, would a Custom View help in maintaining the aspect ratio of the 2D plo...

Print, Merged Cells, and VBA
Hello I'm looking for a code that will help me with a print job for a worksheet. There are a lot of merged cells and a lot of "IF"s to be used in the VBA for range selection. Thanks in advance, Sarr ...

Use VBA to update Access table or Query from Excel
Can I use VBA to update Access table or Query from Excel? Thanks in advance Hi Leungkong, > Can I use VBA to update Access table or Query from Excel? Of course, using ADO or DAO. See: http://www.erlandsendata.no/english/index.php?d=envbadacexportado Regards, Jan Karel Pieterse Excel MVP http://www.jkp-ads.com Hi Jan, Thanks. I think ADO is what I want. But I am not only want to export from excel to access. I want to edit some data in access table. For example, Access has a table "ProductList" I want to use Excel to call the product by "Pro...

How to get font information from clipboard #2
I am writing an image process program. I want to cut or copy some text with font information from other software, such as MS Word, Excel etc . In my program, the text will be draw on screen with same font. So I need to get the font information from clipboard, what should I do? Thanks. ...

VBA and Scheduled task in Outlook
Hi, how can I: a) pull the query from somewhere and send it by e-mail automatically. E.g. I want to take a temperature table from http://www.wunderground.com/history/airport/EHAM/2009/7/10/DailyHistory.html?req_city=NA&req_state=NA&req_statename=NA where 2009/7/10 is the date of yesterday put it into an e-mail and send it automatically each day at 8 o'clock? b) if this is not possible, how can I send an e-mail with the attachment c:\Documents\query20090710.xls each day at 8 o'clock? my boss wants this automatized, I know how to write the VBA code for Excel, but don'...

Outlook 2003 drops signature settings after update
We have 3 machines out of 20 that drop the settings made to Signatures/default signature for new messages/default signature for replies and forwards whenever an Office update (probably a junk mail filter update) is installed. Any idea what causes this behavior? -KK ...

Size Grid
Does anyone here use a size grid, whereas you could enter different sizes and widths, like in footwear and get corresponding reports. What software and version are you on? MSPOS doesn't support Matrix items at all. MS RMS has always supported matrix options, but the interface was reworked & Improved in the newest release, Version 2.0. In addition, there are several 3rd party add-ins that extend the support for Matrix features that has always existed in RMS. Contact your RMS reseller for additional details, or search back in the newsgroups and you should find some references t...

How get rid of reveal codes?
How get rid of reveal codes? the symbols are all over my document!! How do I get rid of them?? Try:- ALT + F9 If my comments have helped please hit Yes. Thanks. "Christa" wrote: > How get rid of reveal codes? the symbols are all over my document!! How do > I get rid of them?? Ctrl+* or Ctrl+Shift+8. See http://word.mvps.org/FAQs/Formatting/NonPrintChars.htm -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "Christa" <Christa@discussions.microsoft.com> wrote in mes...

vba select field
Hi, having a button on a form, is it possible to select only some fields (all from the same table) of the current record instead of all fields? I've tried this code: RunCommand acCmdSelectRecord RunCommand acCmdCopy Forse dipende dei dati nel record. but it selects ALL fields in the form. Thank you. Remigio hi, On 10.04.2010 18:01, remigio wrote: > having a button on a form, is it possible to select only some fields > (all from the same table) of the current record instead of all fields? > I've tried this code: > > RunCommand acCmdSelectRecord &...

I can't change fonts. Why??
Hello! I have a strange problem, with Publisher. I only can use some basic fonts in textboxes. If I choose one (for example Jokerman), the font bar jumps back to Times or to other basic fonts. I have this problem on Vista-Office2007 Beta 2, XP SP2-Office 2003, XP SP2-Office 2000 too. What is interesting, that I can use all of them in the Wordart. In Word I can use all of the fonts too. What could be the matter? Could you help me? Thanks, Gábor from Hungary. ...

VLOOKUP in VBA
On the worksheet I can insert in a cell =VLOOKUP(C5, Hobokee.xls!AcsLow, 2) and it works perfectly, looks up the value in column 2 of the range named AcsLow in the same workbook. But elswhere I want in a macro to lookup the same table and assign the result to a variable BalAmt. BalAmt = VLOOKUP(AccNum, Hobokee.xls!AcsLow, 2) does not work. It gives a function not defined error on Hobokee. If instead of Hobokee I put Workbooks("Hobokee"), it gives function not defined error for VLOOKUP which it changes to VLookup. I have been overVLOOKUP in the Help file and see nothing wrong. W...

Turn pc speaker on/off with vba code
Is this possible? Thanks I found something here on how to do it withVBScript. You can probably modify it to work in VBA http://www.pcreview.co.uk/forums/thread-1468591.php -- HTH, Barb Reinhardt "David" wrote: > Is this possible? > Thanks Thanks Barb I'll have a go (I need to improve my web searching skills) "Barb Reinhardt" wrote: > I found something here on how to do it withVBScript. You can probably modify > it to work in VBA > > http://www.pcreview.co.uk/forums/thread-1468591.php > -- > HTH, > ...

Add a set number to a random entered number
I have to start a vehicle service record and am trying to add the 6000 mile service interval to the mileage at service number. EG. A B C D 1 6000 12000 2 12125 18125 3 18200 24200 etc A is the mileage at service and C is the next service due.I am trying to do this without having a cell with a line of 6000 in it and the formula eg =SUM(A1:B1) in the C cell.Is this possable?Hope some one can help. Hi =A1+6000 HTH. Best wishes Harald "Cyclops" <Cyclops@discussions.microsoft.com> skre...

Excel VBA/Macro programming for beginners
Hi all, I know a bit VB 6.0 programming. Will it help me to write exce vba/macro(same thing?).can anybody help me by providing some fre websites where i can have informations/codes for VBA/macro. Please tell me how could i make a *command Button * in a cell in th excel sheet -- sdebu_200 ----------------------------------------------------------------------- sdebu_2000's Profile: http://www.officehelp.in/member.php?userid=430 View this thread: http://www.officehelp.in/showthread.php?t=118812 Posted from - http://www.officehelp.i Try David McRitchie's "getting started with mac...

graphing two series on x axis
Excel 2000. I have two series plotted on a graph. The 1st is a bar graph containing values for six years, 1999-2004. The 2nd is a line graph having values for only two years, 2003-2004. As is, the 2nd series is plotted in the first two x-values positions of 1999-2000, which is incorrect. To correct this, I dummied the 2nd series to have 4 empty cells at the start so that the 2003 and 2004 values for each series show on the same point on the x axis. However, for those 4 dummied years the line graph shows "0" and plots a line at 0. I would prefer not to see the line in years 1999-2002 ...

Loading a Form from VBA
Hi all, I'd like a module to open and load a form in my Access 2003 database... How can I do this? Use the OpenForm method. Look in the Help file for details. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Mike" <michael.leon.schwartz@gmail.com> wrote in message news:1184770076.109526.207900@o11g2000prd.googlegroups.com... > Hi all, I'd like a module to open and load a form in my Access 2003 > database... How can I do this? > On Jul 18, 10:58 am, "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com&g...

Excel and VBA
I am very interested in learning more about using VBA in office, especially Excel. Can you post some resources (online, books, etc) that can be used to help learn about using Visual Basic in office. Thanks! Here's a good place to start: http://www.contextures.com/xlbooks.html Does that help? *********** Regards, Ron XL2002, WinXP "Bob Sinclair" wrote: > I am very interested in learning more about using VBA in office, especially > Excel. Can you post some resources (online, books, etc) that can be used to > help learn about using Visual Basic in office. >...