Creating dynamacially Macro into new Document.

  • Thread starter Tolga Yaramis via OfficeKB.com
  • Start date
T

Tolga Yaramis via OfficeKB.com

Hi all

I wrote a macro that splits mail merge document to seperated documents.
is it possible to add AutoRun macro for each document?

Because in the main document I am using an ocx and I am setting the licence
properties with one line code statement. after spliting mail merge
document, the licence must be setted for each document.
Because of that I want to add AutoRun macro into each document with same
code line. like this...

Sub Autorun()
TBarCode51.LicenseMe "Mem: LicenceName", eLicKindDeveloper, 1, "4564213",
eLicProd1D
End Sub

Thanks alot in advance...

Tolga
 
J

Jezebel

It's technically possible by manipulating the VBE object. But there are
serious security issues. You will have a lot of trouble getting this to run
on other people's computers: a) there is the issue with macro security in
general, and b) Word 2003 generally blocks any attempt to manipulate its own
VBA from code.

Find another way.
 

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