Sending function to VBA from VB6

A

Andrew

Hi there

I want to create a function in VB6 that can be copied from a VB6 application to the VBA area in a Word 2002 file so that it works as if I had created the macro in Word itself. The functionality provided will create a menu item that can perform specific duties. Any one know how to do this? I have read somewhere about VBE, VBProjects but there is not enough detail

Thanks in advance
 
J

Jezebel

It's certainly do-able, but you're jumping into the deep end if you're not
familiar with VBA.

The short answer is that you do it using the methods of the VBProject object
of the template or document to which you want to add the code. Through the
VBProject object you can get to -- or add -- project modules, and add or
modify code to those modules.

You'll need to read Help on how these object work: it's too complex to
explain in a forum post.

However it's usually a better method and easier to provide your user with an
add-template with the code already in place. Making modifications on the fly
to the user's VBA set-up can easily run foul of security settings and of
other add-ins they might have installed. It's considered bad practice to
modify the user's normal.dot.




Andrew said:
Hi there.

I want to create a function in VB6 that can be copied from a VB6
application to the VBA area in a Word 2002 file so that it works as if I had
created the macro in Word itself. The functionality provided will create a
menu item that can perform specific duties. Any one know how to do this? I
have read somewhere about VBE, VBProjects but there is not enough detail.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top