Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-25-2012, 06:04 AM
RichardP RichardP is offline Problem saving in Word 2007 a dotm Addin developed in Word 2010 Windows 7 32bit Problem saving in Word 2007 a dotm Addin developed in Word 2010 Office 2010 32bit
Novice
Problem saving in Word 2007 a dotm Addin developed in Word 2010
 
Join Date: Apr 2012
Location: France 80%, UK 20%
Posts: 9
RichardP is on a distinguished road
Smile Late binding must be the way to go

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 (,/ and other French specifics, and I'm carfeful not to use any features introduced with Word 2010 (I originally developed the AddIn in Word 2003 and hope to make this 2010 version backward compatible, thanks to you).



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
Reply With Quote
Reply

Tags
2007, 2010, addin compatibility



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem suddenly developed with captions Big Ry Word 1 01-15-2012 01:26 PM
Problem saving in Word 2007 a dotm Addin developed in Word 2010 Copy/Paste from Paint to Word - There is a problem saving the file 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
Problem saving in Word 2007 a dotm Addin developed in Word 2010 Word 2007 crashes due to corrupt normal.dotm 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

Other Forums: Access Forums

All times are GMT -7. The time now is 05:27 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft