PowerPoint Script Generator Sample
Note
This sample runs only in Microsoft Office Word 2007.
This sample is a Word template that enables you to create a first draft of a Word document from a Microsoft Office PowerPoint 2007 presentation, without having to copy and paste information from PowerPoint into Word. The Word document content is generated from a PowerPoint presentation that you select, using a wizard.
To make this sample template accessible from the Word template dialog box, put the sample template in a standard templates folder such as %UserProfile%\Application Data\Microsoft\Templates (Windows XP or Windows Server 2003) or %UserProfile%\AppData\Roaming\Microsoft\Templates (Windows Vista).
Security Note: |
---|
This sample code is intended to illustrate a concept, and it shows only the code that is relevant to that concept. It may not meet the security requirements for a specific environment, and it should not be used exactly as shown. We recommend that you add security and error-handling code to make your projects more secure and robust. Microsoft provides this sample code "AS IS" with no warranties. |
To run this sample
Press F5.
An empty Word document opens, created from the sample template. A new menu named Samples and a Create Script toolbar button are available.
On the Samples menu, click Create Script.
The Script Generator wizard appears.
Click Next in the wizard.
Type the location of a PowerPoint presentation into the File location text box, or click Browse to browse to the location, and then click Next.
Select the slides that you want to include content from, and clear the check box next to slides that do not contain content that you want for the document.
Click Next.
Select the options that you want for the document, and then click Next.
Click Finish to create the document.
XML tags are visible in the document by default. To hide the XML tags:
Open the View menu.
Click Task Pane.
Click XML Structure in the list of task panes at the top of the new pane.
Clear the Show XML tags in document check box.
You can add content from slides in another presentation by running the Script Generator wizard again. The new content is added to the end of the document.
Requirements
For full functionality, this sample requires:
Microsoft Office PowerPoint 2007.
The PowerPoint primary interop assembly installed in the global assembly cache. For more information, see How to: Install Office Primary Interop Assemblies.
Demonstrates
This sample demonstrates the following tasks:
How to automate PowerPoint from within Word.
How to add XML to a Word document.
How to modify Word menus and command bars.
See Also
Concepts
Programming Document-Level Customizations
Word Document-Level Customization Development