![]() |
|
#1
|
|||
|
|||
![]()
Thanks so much Paul, very helpful.
Importing 132 modules each time I update my AddIn is too complicated. I have checks in my code for argument separator (,/ ![]() So late binding must be the way to go (I lose Intellisense, don't I?) In practice, does this mean I should change all my Dim xlApp as Excel.Application to Dim xlApp as Object (and likewise for ppApp, olApp)? I have one class module that may be a problem and I'm not sure how to handle late binding in this respect. Here's the (fairly self-explanatory) code: '''=========ThisApplication.cls Option Explicit Public WithEvents oApp As Word.Application ------------------------------ Private Sub PsuedoAutoNew() Show_WOTTToolBar ViewSet "New" ZoomSet "New" End Sub Private Sub PsuedoAutoOpen() Show_WOTTToolBar ViewSet "Existing" ZoomSet "Existing" End Sub Should I change Public WithEvents oApp As Word.Application to ... As Object? Then write a Class_Initialize() and Class_Terminate()? And in the code module containing the AddIn's Autoexec: '''======= Support_Autoexec.bas Option Explicit Dim oAppClass As New ThisApplication 'i.e. new instance of class named 'ThisApplication' (see class module) Public oldNoOfOpenDocs As Long Public FirstNewDoc As Boolean Public Sub Autoexec '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''' 'NB This only fires if this .dot(m) is a global template, i.e. in Word's Startup 'folder. It doesn't fire if this file is opened anywhere else ' THIS Autoexec fires AFTER the one in Normal.dot(m) ' ' and BEFORE the routines in the ThisApplication class module ' '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''' Set oAppClass.oApp = Word.Application oldNoOfOpenDocs = 0 FirstNewDoc = True "PUT ALL START-UP CODE HERE: WOTT Menu, WOTT Toolbar, WOTT Word 'settings,WOTT keyboard assignments etc. A_InitWOTT End Sub Thanks in advance for your invaludable advice Richard |
![]() |
Tags |
2007, 2010, addin compatibility |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem suddenly developed with captions | Big Ry | Word | 1 | 01-15-2012 01:26 PM |
![]() |
one2three | Word | 1 | 10-26-2011 07:35 AM |
How to use .dotm template extension in MS Word? | dude444 | Word | 0 | 09-20-2010 09:34 AM |
![]() |
stevebond001 | Word | 1 | 05-11-2010 10:49 AM |
Outlook 2007 addin problem with Visual Studio 2010 RC ? | johaseo | Outlook | 0 | 04-16-2010 02:49 PM |