473,575 Members | 3,321 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems with Events in PowerPoint-AddIn

I created a VB.NET-PowerPoint-AddIn as described in the VisualStudio
2003 documentation. That works very well.

The AddIn adds a new toolbar to PowerPoint if the active document is
based on a certain master. So I had to catch all events that notify a
change of the active presentation.

For that, I made two approaches:

1. A method that handles the apropriate events directly via HANDLES:

Private Sub WindowActivate( ByVal ppPres As PowerPoint.Pres entation,
ByVal Wn As PowerPoint.Docu mentWindow) Handles
applicationObje ct.WindowActiva te, applicationObje ct.WindowDeacti vate
....
End Sub

2. A more complicated approach with <DispId(xx)> that works better, as I
get a WindowChanged-event:

<DispId(2009) > Public Sub WindowChanged(B yVal ppPres As
PowerPoint.Pres entation, ByVal Wn As PowerPoint.Docu mentWindow)
....
End Sub

For this to work I had to declare this in the OnStartupComple te method:

' sink application events
Dim oConnPointConta iner As UCOMIConnection PointContainer
' QI for IConnectionPoin tContainer.
oConnPointConta iner = CType(applicati onObject,
UCOMIConnection PointContainer)
' Create a new variable that contains the GUID of the
' PowerPoint.EApp lication interface.
Dim guid As New Guid("914934C2-5A91-11CF-8700-00AA0060263B")
' Find the connection point.
oConnPointConta iner.FindConnec tionPoint(Guid, m_oConnectionPo int)
' Call Advise to sink up the connection.
m_oConnectionPo int.Advise(Me, m_Cookie)

and this in the OnDisconnection method:

' Call Unadvise to remove the sink to the connection.
m_oConnectionPo int.Unadvise(m_ Cookie)
System.Runtime. InteropServices .Marshal.Releas eComObject(appl icationObject)
GC.Collect()

Both approaches work, but they both somehow circumvent PowerPoint's
native check for the document beeing saved. I think I would have to
forward the event to PowerPoint after my method for it has been called,
but I have no idea how to do this.

Any hints?

Alexander
Nov 21 '05 #1
0 1651

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
568
by: Ata | last post by:
Hello, I am trying to copy the contents of the output of SQL Reporting Services to a PowerPoint slide. For this, I am using SQL Reporting Services to obtain an IMAGE stream, which I paste to the Windows clipboard. Then, using automation, I am trying to copy this information from the clipboard to a PowerPoint slide. However, I get an error...
6
3396
by: C Williams | last post by:
Hi, I am writing some VB.NET code that compiles to a dll. There is some code within it that manipulates Powerpoint 2003. The dll I am writing is for smart tags, and I am having trouble because sometimes Powerpoint is remaining running (powerpnt.exe in Task Manager). One action of my smart tags calls InsertChart (code below). The...
2
10193
by: WillRead | last post by:
I have a VB.Net application and a PowerPoint presentation explaining how each form in the application works, etc.. I would like to select and display the slide appropriate for each form by pressing the F1 key. In other words, I want to use the powerpoint presentation for my help system. I am calling the SlideShow from the applications menu,...
4
42126
by: Joseph | last post by:
I am trying to open a 3 powerpoint presentation simultaneously afte each other without interruption, the operator of the application doe not need to notice anything or interfere in the operation of th transition between the 3 presentations. Let us say I have three powerpoint presentation Presentation 1 Presentation 2, and Presentation 3. ...
0
2551
by: Marc Eggenberger | last post by:
Hi there. I have an webapp (asp.net) which should use powerpoint to create a presentation and then send that presentation to the user. I'm using VS2003 and Office2003 (project req.). The webapp runs find but when I try to open powerpoint in my asp.net code I get an error
1
1315
by: Kishor | last post by:
Hi, I am developing an application which is to be used with power point. I am now in need of help from you guys. In my Application (developing using VB.net), I am creating the object of the power point everything is working fine, but the events are not firing. I am here pasteing code please see this. 'Declaration Public WithEvents op As...
8
7064
by: Rut | last post by:
Does anyone know how to start powerpoint from vb.net without the ppt screen appearing. I want to keep it hidden? Using this code: Try pp = New PowerPoint.Application pp.Visible = Office.MsoTriState.msoTrue pp.WindowState = PowerPoint.PpWindowState.ppWindowMinimized Application.DoEvents()
2
1385
by: starsign | last post by:
Hi, I am trying to hook up to PowerPoint events from my c# applicaton. I have seen the msdn article on how to do it but I cannot get it to work (I am using PowerPoint 2003). Does anyone have any code that they can share / guidance? Thanks, Ashley
6
6310
by: BWPanda | last post by:
Hi everyone, I'm wanting to use VB.NET to display a powerpoint presentation, much the same way as the presenter that comes with PowerPoint (when used on multiple monitors). Basically, I want to show the presentation in one form/window, and in the other, have controls for moving through the presentation, list of slides, etc. I don't...
1
11855
by: chrizstone | last post by:
Hi Guys, What i want to do is: I want to create a Slide programmatically where a Table is on it! Here´s my Code: String strTemplate; strTemplate = template; String tableSlide = @"C:\Temp\TableSlide_" + guid.ToString();
0
7845
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7775
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8120
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
6515
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5338
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3778
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3797
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2286
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1382
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.