PowerPoint Automation Doco?
-
I am trying to build a PowerPoint presentation using automation in MFC and not getting real far. As usual, the code examples given by MS in MSDN on how to do this only shows the advanced topics and leaves the easy stuff as an exercise. The problem is that there is no offical documentation that I can find on doing the easy stuff like adding a text box and changing the font color. I was wondering if anyone knows of any documention and/or better examples on adding/formatting slides in a presentation. What I am trying to do is simple and shouldn't be this hard :eek: . I am adding text boxes which I figured out after many hours but I am unable to change the font color. I would like to do more once I figure out how the interface works. Thanks!
-
I am trying to build a PowerPoint presentation using automation in MFC and not getting real far. As usual, the code examples given by MS in MSDN on how to do this only shows the advanced topics and leaves the easy stuff as an exercise. The problem is that there is no offical documentation that I can find on doing the easy stuff like adding a text box and changing the font color. I was wondering if anyone knows of any documention and/or better examples on adding/formatting slides in a presentation. What I am trying to do is simple and shouldn't be this hard :eek: . I am adding text boxes which I figured out after many hours but I am unable to change the font color. I would like to do more once I figure out how the interface works. Thanks!
Todd Hoop wrote: The problem is that there is no offical documentation that I can find on doing the easy stuff like adding a text box and changing the font color. I didn't play with automating PowerPoint - only with Excel and Word. The best way to get basic knowledge of the object model is to record some macros. You'll get the VB code in VBA Editor which you should be able to quite easily translate into C++ calls - method names will be identical. Just add textboxes and change the color. Also, press F2 in VBA and you'll get Object Browser which presents objects, methods and properties. Tomasz Sowinski -- http://www.shooltz.com
-
Todd Hoop wrote: The problem is that there is no offical documentation that I can find on doing the easy stuff like adding a text box and changing the font color. I didn't play with automating PowerPoint - only with Excel and Word. The best way to get basic knowledge of the object model is to record some macros. You'll get the VB code in VBA Editor which you should be able to quite easily translate into C++ calls - method names will be identical. Just add textboxes and change the color. Also, press F2 in VBA and you'll get Object Browser which presents objects, methods and properties. Tomasz Sowinski -- http://www.shooltz.com
Tomasz, Thanks for the reply. I tried that path which does give an idea on how the objects come together but when implemented (changing font color in this case), I received errors stating that I am using objects that are not allowed in the current view. I believe it is from a .Select() call which is used to select the text to receive the font color change. I will check out Objects Browser to see if it offers any clues. Thanks!