473,498 Members | 891 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Change PowerPoint table font size from Access VBA?

4 New Member
Hello - trying to change PowerPoint (PP) table font size from Access VBA?

My code creates a new PP presentation and applies a user selectable PP template. The code also creates a table based on Access data parameters. I am able to format the PP table boarders and fill .... just not the font size.

Partial code below:
...
Expand|Select|Wrap|Line Numbers
  1. 'POWERPOINT
  2. Dim pptObj As PowerPoint.Application
  3. Dim pptPres As PowerPoint.Presentation
  4. Dim pptSlide As Slide
  5. ...
  6. 'Create a new file from an existing PowerPoint template
  7. Set fd = Application.FileDialog(msoFileDialogOpen) 'Open dialog to ask user to select PowerPoint template
  8. With fd
  9.     .Show
  10.     pptfile = .SelectedItems(1)
  11. End With
  12. Set pptObj = CreateObject("PowerPoint.Application")
  13. With pptObj
  14.     .Visible = True
  15. End With
  16. Set pptPres = pptObj.Presentations.Add
  17. ...
  18. lngX = 1
  19. lngY = 1
  20. lngShapeID = 2
  21. With pptPres '1st With Statement
  22.     With .Slides.Add(pptPres.Slides.Count + 1, ppLayoutTitle) '2nd Withstatement
  23.         .ApplyTemplate (pptfile) 'apply powerpoint template file selected by user
  24.         .Shapes.AddTable (ABSFindRecordCount + COMMFindRecordCount + InstrumFindRecordCount + MDIOCFindRecordCount + RangesFindRecordCount + SBSFindRecordCount + TSSFindRecordCount + 1), 6, 3, 90, 300, 60 'rows+header, columns,horizontal center, vertical center, width, height
  25. lngX = 1
  26. lngY = 1
  27. lngShapeID = 2
  28.  
  29.        'Format table columns
  30.        lngShapeID = lngShapeID + 1
  31.        With .Shapes(lngShapeID).Table '3rd With Statement
  32.             .Columns(1).Width = 187
  33.             .Columns(2).Width = 85
  34.             .Columns(3).Width = 85
  35.             .Columns(4).Width = 85
  36.             .Columns(5).Width = 85
  37.             .Columns(6).Width = 187
  38.  
  39.             'format table, no fill, black boarder
  40.             .ApplyStyle ("{5940675A-B579-460E-94D1-54222C63F5DA}")
...


Thanks, in advance, for any help!!
Apr 17 '13 #1
1 5006
frogman123
4 New Member
Ok, figured it out. following the bottom of my code above I have code that writes the table header out. Just needed to add two lines after writing value. The two lines change size to 12pt and then make it bold. Has to be done table cell by cell. Here is the code:


Expand|Select|Wrap|Line Numbers
  1. ...
  2.             'Write table header from Access table
  3.             lngX = 1
  4.             lngY = 1
  5.             RSpptblHeader.MoveFirst
  6.             While Not RSpptblHeader.EOF
  7.                 .Cell(lngY, lngX).Shape.TextFrame.TextRange.Text = RSpptblHeader.Fields("Header").Value
  8.                 .Cell(lngY, lngX).Shape.TextFrame.TextRange.Font.Size = 12 '12pt font
  9.                 .Cell(lngY, lngX).Shape.TextFrame.TextRange.Font.Bold = msoTrue 'make it bold
  10.                 RSpptblHeader.MoveNext
  11.                 lngX = lngX + 1
  12.             Wend
  13.  
  14.  
  15. ...
  16.  
Apr 17 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
13229
by: Jon | last post by:
Hi, I have table text set to 85%, I may change that to em's but for now haven't If I have a table nested within the table I get font size of 85% of 85% = 72% - too small. Without...
15
7159
by: lharby | last post by:
Basic question, is this possible? I have managed to crib a javascript function that allows the user to increase or decrease the font size of a page. (see...
3
3318
by: Dave | last post by:
Hi, I am relatively new to css and am trying to find the font-size I like best to use as default. I would prefer to use em values as I found that it looks consistent between Firefox and IE,...
2
2159
by: jeff regoord | last post by:
Is it possible to change the table structure in Access once the table has data in it and how would one attempt this if so?
2
15019
by: Woody Splawn | last post by:
When placing labels and text boxes on winforms they are coming up by default in a size that is just a little too small. How do I change this so that in the future they will come up with a bigger...
7
3033
by: Daniel Kaplan | last post by:
I have the item below at the top of my style sheet. And it seems that the font-szie is ignored. I know that my linked style sheet is being read, and used because if I remove the font-family line,...
7
10031
by: xformer | last post by:
Hello everybody, today I was working on a web site when I found a strange effect. Take the following html document: ----begin---- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01...
71
5709
by: Mark | last post by:
Sorry if the question is a bit basic. I generally express my font sizes in pixels, originally to handle the Macintosh/Windows font size differences (though I believe that they both now treat...
3
4120
by: MLH | last post by:
Without modifying the default font settings everywhere, is there any way to specify it for just message boxes? MsgBox "I would like this text to be larger for all message boxes." ???
0
1294
by: Dan Bass | last post by:
Greetings all! Quick question: Is there anyway to change the default font size of a text box render to Mobile Internet Explorer? I'm developing a Windows Mobile 2005 device... All textboxes in...
0
7124
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
5460
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4904
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4586
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1416
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
651
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.