LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ActiveX: (a) per property? (b) code a macro

I'm working to build a few simple functions that use ActiveX to control PowerPoint, and need some guidance.

Most of what I'm trying to do is in the attached VB macro file - add a slide, specify its layout, put text in the title and paste a bitmap from the clipboard.

Two main questions, which I hope will be easy for someone to answer despite the length of them:

1. What is the practical difference for me between generating the fp "per property" or "per server"? I see that the PP2000.fp that shipped with CVI 6 seems to be done per server, though the ActiveX Controller Wizard seems to be steering me to make the much bigger "per property" version. Will "per property" allow me to use one line of code, rather than several "GetProperty" calls in a row required with a "per server" fp?

2. Take for example this line of the attached macro:

ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=1, Layout:=ppLayoutTitle).SlideIndex

Am I correct that (at least in the "per server" approach) I need to:
- use GetProperty to get a handle for the active window
- use GetProperty to get a handle for the view property of that active window
And before using the ViewGotoSlide method, I need to
- then use GetProperty to get a handle for the active presentation property
- use GetProperty to get a handle for the Slides property
- use PP_SlidesAdd fp function to invoke the method to set the index and layout
.. And this is where I get a bit lost. How do I tie in that .SlideIndex and also tie it all back to the call to the ViewGotoSlide method?

Thanks in advance for any help!

(I'm hoping that soon this will all be painfully obvious to me, but I'm not there yet!)
0 Kudos
Message 1 of 3
(3,084 Views)
Per server will generatw onw GetProperty() and SetProperty() function for you vs. per property will generate a seperate get/set function for each property. The methods will be set up the same way. The difference between the two is the type of interface they use to actaully talk to the activex server. You should be ok with either type.

The following call can be broekn down

ActivePresentation.Slides.Add(Index:=1, Layout:=ppLayoutTitle).SlideIndex

as

dim slides as Slides
set slides = ActivePresentation.Slides
Dim slide As Slide
set slide = slides.Add(Index:=1, Layout:=ppLayoutTitle)
dim index
index = slide.SlideIndex

So the final call would be

ActiveWindow.View.GotoSlide index


Once you break it down like this, it becomes easier to see how to use the CVI wrapper functions.

I hope this helps
Bilal Durrani
NI
0 Kudos
Message 2 of 3
(3,066 Views)
Thanks, BilalD. That definitely helps.

--Ian
0 Kudos
Message 3 of 3
(3,053 Views)