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