Access Cookbook - Ken Getz [271]
Delete all the rows from tblSlides and tblParagraphs, the two tables containing the presentation information (you may want to make copies of the originals first, in case you need to refer back to them). Leave the two tables whose names start with "tlkp" alone: these tables are necessary for the application to run and contain information about enumerations provided by the PowerPoint object model.
Using zsfrmSlides or editing the table directly, add one row to tblSlides for each slide in your presentation. The SlideNumber field is used for sorting the slides in the presentation (you can enter them in the table in any order you like, but make sure the SlideNumber field reflects the desired output order). The SlideLayout field tells PowerPoint which of its layouts you want to use for the slide: choose its value from the combo box, which pulls its values from tlkpLayouts. It may take some experimentation to find the layout you want. The Include field tells the application whether or not to create a slide in PowerPoint; this way, you can create all your slides in Access but export only selected slides to PowerPoint. Figure 12-14 shows zsfrmSlides gathering slide information.
Figure 12-14. Use zfrmSlides to add new slides to your presentation
Using zsfrmParagraphs or editing the table directly, add one row to tblParagraphs for each paragraph on each slide in your presentation. Table 12-10 lists the fields with comments about each. This table is linked to tblSlides on the SlideNumber field and should include one row for each output paragraph that you need. The three fields, SlideNumber, ObjectNumber, and ParagraphNumber, together make up the primary key; the combination of the three must be unique (none of these fields can be left blank for a given paragraph). Figure 12-15 shows zsfrmParagraphs gathering paragraph information.
Figure 12-15. Use zsfrmParagraphs to add or edit paragraph text and properties
Table 12-10. Field values allowed in tblParagraphs
Field
Values
Description
SlideNumber
Any valid slide number.
Slide number for this paragraph.
ObjectNumber
Any valid object number, depending on the slide layout. This example app does not support adding new objects.
Object number on the selected slide. All text boxes and other items count as objects.
ParagraphNumber
A contiguous, incrementing number, based on previous paragraphs in the selected object.
Paragraph within the object.
IndentLevel
An integer between 1 (no indent) and 5.
Number of levels to indent this paragraph.
Text
Any text, up to a reasonable length (six or sevenwords).
Text for the selected paragraph.
FontName
Any valid installed font. Leave blank to use the default font for the style you've selected.
Name of the font for this paragraph.
FontSize
Any valid font size (1 to 127). 0 indicates that you want to use the default font size for the style you've selected
Font size for this paragraph.
Color
Numeric value representing the color you want to use for your paragraph. 0 indicates that you want to use the default color for the style you've selected.
Color for this paragraph.
Shadow
Select from Yes (-1), No (0), or Use Slide Default (1).
Shadow for this paragraph?
Bold
Select from Yes (-1), No (0), or Use Slide Default (1).
Make this paragraph bold?
Italic
Select from Yes (-1), No (0), or Use Slide Default (1).
Make this paragraph italicized?
Underline
Select from Yes (-1), No (0), or Use Slide Default (1).
Underline this paragraph?
Bullet
Select from the values provided in the lookup table, tlkpBulletTypes.
Type of bullet to use.
Before creating your presentation, peruse the data in tblSlides, making sure that the Include field is set the way you want it (i.e., to include or exclude each slide).
Using frmPowerPoint as previously described,