Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / July 2007

Tip: Looking for answers? Try searching our database.

Class functionality for multiple templates

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mamue - 21 Jun 2007 08:08 GMT
Hi,
I develop in Word 2000 (VB6). I have a class that offers functionality
to multiple modules (macros). Now i have multiple templates that also
need that functionality. Instead of copying the class to each template
i search for a more comfortable way, with only one instance. Is the
only solution to create a dll file?

greetings m
Jonathan West - 21 Jun 2007 10:43 GMT
> Hi,
> I develop in Word 2000 (VB6). I have a class that offers functionality
[quoted text clipped - 4 lines]
>
> greetings m

You can use Tools References in the VBA editor to set a reference to another
template and the code included there. But I don't recommend that arrangement
if you are likely to be distributing your code to other users. The full
pathname of the reference is hardcoded into your template, which means you
have no flexibility as to where the referenced template will be installed on
customer machines.

With ActiveX DLLs, once the DLL is registered, code can find it wherever the
DLL is located. The same does not apply to .dot files which you reference.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

mamue - 21 Jun 2007 12:34 GMT
Hi Jonathan,

how can i generate those ActiveX DLLs? Do i have to copy and paste my
code to Visual Studio to build them?

greetings mamue

> > Hi,
> > I develop in Word 2000 (VB6). I have a class that offers functionality
[quoted text clipped - 19 lines]
> Jonathan West - Word MVPwww.intelligentdocuments.co.uk
> Please reply to the newsgroup
Jonathan West - 21 Jun 2007 13:41 GMT
> Hi Jonathan,
>
> how can i generate those ActiveX DLLs? Do i have to copy and paste my
> code to Visual Studio to build them?

You would need to get hold of a copy of Visual Basic 6. The current version
of Visual Studio uses VB.NET, which is a quite different language,despite
the similarity of name.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

Mamue - 02 Jul 2007 09:24 GMT
Hmm, i only have a copy of the latest Visual Studio. Is there any free
alternative IDE to build VB 6 dll's ?

> > Hi Jonathan,
>
[quoted text clipped - 9 lines]
> Jonathan West - Word MVPwww.intelligentdocuments.co.uk
> Please reply to the newsgroup
Shauna Kelly - 21 Jun 2007 10:53 GMT
Hi mamue

Creating a DLL is one solution, and that certainly works very well.

If you don't want to do that, you can put your class in a .dot file, load
the .dot as a an addin (ie a global template). You can call code in that
addin from your templates. In the template, in the VB IDE, use Tools >
References to create a reference to the addin. Then, you can create an
instance of the class from the template in the same way as described at the
bottom of this page: http://www.cpearson.com/excel/ClassModules.htm. It's
written for Excel, but the principles are the same.

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

> Hi,
> I develop in Word 2000 (VB6). I have a class that offers functionality
[quoted text clipped - 4 lines]
>
> greetings m
mamue - 21 Jun 2007 12:24 GMT
Thanks a lot Shauna,

this guide is exactly what i needed ;-)

On 21 Jun., 11:53, "Shauna Kelly"
<ShaunaKe...@SendNoSpamToShaunaKelly.com> wrote:
> Hi mamue
>
[quoted text clipped - 20 lines]
>
> > greetings m
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.