Working with Office 2013
Working with Office 2013
Working with Office 2013
Working with Office 2013
Working with Office 2013
Working with Office 2013 Working with Office 2013 Working with Office 2013 Working with Office 2013 Working with Office 2013 Working with Office 2013 Working with Office 2013 Working with Office 2013
Working with Office 2013 Working with Office 2013
Working with Office 2013
Go Back  Xtreme Visual Basic Talk > > > Working with Office 2013


Reply
 
Thread Tools Display Modes
  #1  
Old 08-07-2013, 12:52 PM
Alex30 Alex30 is offline
Regular
 
Join Date: Sep 2007
Posts: 51
Default Working with Office 2013


Hello,

I have a COM add-in developed in VB.NET (VS 2010).

It works with Word, Outlook, PowerPoint and Excel 2007 and 2010.

However, it doesn't work with Excel and Outlook 2013, while working good with Word and PowerPoint 2013.

I've compiled it with references to Office 15, but it didn't help.

Here is a code that I use:
Code:
Imports Extensibility
Imports System.Runtime.InteropServices

Imports Office = Microsoft.Office.Core
Imports Word = Microsoft.Office.Interop.Word
Imports Excel = Microsoft.Office.Interop.Excel
Imports PowerPoint = Microsoft.Office.Interop.PowerPoint
Imports Outlook = Microsoft.Office.Interop.Outlook

Imports Microsoft.Office.Core

Public Class Connect
	
    Implements Extensibility.IDTExtensibility2, Office.IRibbonExtensibility

Private applicationObject As Object
    	Private addInInstance As Object


	
	Public Sub OnBeginShutdown(ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnBeginShutdown
	End Sub
	
	Public Sub OnAddInsUpdate(ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnAddInsUpdate
	End Sub
	
	Public Sub OnStartupComplete(ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnStartupComplete

	End Sub

Public Sub OnConnection(ByVal application As Object, ByVal connectMode As Extensibility.ext_ConnectMode, ByVal addInInst As Object, ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnConnection

addInInstance = addInInst 'Part of shared add in structure

            If TypeOf (application) Is Word.Application Then
                applicationObject = CType(application, Word.Application)
                objWord = DirectCast(System.Runtime.InteropServices.Marshal.GetActiveObject("Word.Application"), Word.Application)
            ElseIf TypeOf (application) Is Excel.Application Then
                applicationObject = CType(application, Excel.Application)
                objExcel = DirectCast(System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application"), Excel.Application)
            ElseIf TypeOf (application) Is PowerPoint.Application Then
                applicationObject = CType(application, PowerPoint.Application)
                objPowerPoint = DirectCast(System.Runtime.InteropServices.Marshal.GetActiveObject("PowerPoint.Application"), PowerPoint.Application)
            ElseIf TypeOf (application) Is Outlook.Application Then
                applicationObject = CType(application, Outlook.Application)
                objOutlook = DirectCast(System.Runtime.InteropServices.Marshal.GetActiveObject("Outlook.Application"), Outlook.Application)
            End If

End Sub
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Working with Office 2013
Working with Office 2013
Working with Office 2013 Working with Office 2013
Working with Office 2013
Working with Office 2013
Working with Office 2013 Working with Office 2013 Working with Office 2013 Working with Office 2013 Working with Office 2013 Working with Office 2013 Working with Office 2013
Working with Office 2013
Working with Office 2013
 
Working with Office 2013
Working with Office 2013
 
-->