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

--
Message posted via http://www.officekb.com

Re: Creating dynamacially Macro into new Document. by Jezebel

Jezebel
Wed May 04 17:01:59 CDT 2005

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.


"Tolga Yaramis via OfficeKB.com" <forum@nospam.OfficeKB.com> wrote in
message news:0eb453a1e53d4100a4ab0ae64797baa5@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
>
> --
> Message posted via http://www.officekb.com