MS Office defines the modules that can contain code as VBComponents. The VBComponent types include Standard Modules, Slides, Forms, etc. The following code accepts a Presentation and the code as input parameters. It will create Standard Module type VBComponent if required and add the code in it. Microsoft Visual Basic for Applications Extensibility needs to be included in the set of references. To add a reference to it
Sub InsertCode(ByVal
Pres
As Presentation, ByVal
Code
As String) |