473,722 Members | 2,397 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 1655

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 at slide.Shapes.PasteSpecial. I am able create a System.Drawing.Bitmap object from the memory...
6
3409
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 designated line causes powerpoint to remain running even after the user has manually closed the...
2
10208
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, and it works great; however, the same techniques are not working for selecting individual slides. ...
4
42143
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. I like to fire them from a window form on the click event of a butto on the form. The sequence of...
0
2555
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
1323
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 New PowerPoint.Application()
8
7075
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
1390
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
6321
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 really want code as such, more like a tutorial on how to do something like this.
1
11893
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
8863
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8739
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9384
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9157
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8052
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5995
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3207
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
2
2602
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.