PowerPoint Automation thru VB.Net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have been succesfully doing PowerPoint Automation programming using VB6. I
created a dll and I call the functions of that dll from a Macro written
inside PowerPoint. I created a clsPowerPoint.cls classin VB6 dll and created
an object of this class in PowerPoint VBA Macro Module and called the
functions easily. But, I m finding it hard to do such a thing in VB.Net. I
made a Class PPTAuto in VB.Net and wrote some functions inside it. But, when
I tried to create an object of this class in PowerPoint VBA MAcro Module then
it won't work as it was working in case of VB6 dll.

Can anyone please help me in this. I need to convert my VB6 code to VB.Net
code and this is the initial problem that I m facing.

Thanks a lot in advance.
 
The move from unmanaged code (VB) to managed code (.Net) is not an easy one
and in most cases you won't be able to convert existing code, you'll
completely rewrite it.

You don't say how you are going about this but in gerneral you are going to
need to install the PIAs (Program Interop Assemblies) for PowerPoint and any
controls you plan to use. You will also need to reference PowerPoint, and
the Office core, and additional controls you may need. Finally in your
"connect.vb" code you will need to specify exactly how this should load,
what it should do, and how to disconnect when done.


Austin Myers
MS PowerPoint MVP Team

Provider of PFCMedia http://www.pfcmedia.com
 
Thanks for the Info. I didn't had any idea about PIAs. I got to know about it
first time when you replied. I guess I need to research more about this now.
Feels like it was better to program on VB6 rather than on .Net; so many
complicaies in .Net (CLR, MSIL..etc etc).

Thanks a lot.
 
technoknight said:
Thanks for the Info. I didn't had any idea about PIAs. I got to know about
it
first time when you replied. I guess I need to research more about this
now.
Feels like it was better to program on VB6 rather than on .Net; so many
complicaies in .Net (CLR, MSIL..etc etc).

Thanks a lot.


Let me warn you, as of right now there are no VSTO (Visual Studio Tools for
Office) when it comes to PowerPoint and that means you are going to have to
do a LOT of coding by hand. I've been updating some of our add ins with
..Net (in preperation for Office 12 and Windows Vista) and I'll simply tell
you there is very little about it that is easy and very little in the way of
knowledgebase or MSDN documentation on doing this. (I suspect after MS
builds tools they will provide the documentation.)

Not saying you can't do it, just that it's going to take a pretty good
investment in time.


Austin Myers
MS PowerPoint MVP Team

Provider of PFCMedia http://www.pfcmedia.com
 
I have installed the PIAs for Office 2002. Also, I followed the Microsoft
document explaining "How to Automate PowerPoint using VB.Net". I have started
to understand the PIAs.

But, I have a problem. I have created a custom button in PowerPoint. Now
what I want is when I click that button it should invoke a function from my
VB.Net dll. I have to write an addin (ppa/macros) so that it intercepts my
"button"-click and then calls the function from the desired dll. I am facing
problems calling VB.Net dll function from PowerPoint VBA (addin macro). I
read that I need to select a reference to my dll file first. So in the
PowerPoint VBA section I went to Tools -> References and then tried to add my
dll app.dll, but it says that it cannot create a reference to the specified
file. When I tried to register app.dll it said that "dll was loaded but entry
point was not found"...something like this error.

Can anyone please help me regarding:
1.) How to call a VB.Net dll function from PowerPoint VBA macro?
2.) Why am I getting this error regarding "cannot find entry point". How can
I resolve it?

Thanks a lot in advance.
 
Back
Top