Hi,
I have lots of files that contain macros that need to be changed. The
changes are:
- changing a textbox Lock from False to True
- search and replace text in the macro
- delete some text

How can I loop through all these files and do the changes? The macro is
protected with password.

I know how to loop through the templates and do changes in the document
itself, but not how to change the macros.

/ Ulf

Re: Changing macro using macro by Jonathan

Jonathan
Fri Nov 03 04:10:59 CST 2006


"Ulf Nilsson" <UlfNilsson@discussions.microsoft.com> wrote in message
news:A2B87738-59AF-482F-AF0C-9B6720ED6DD6@microsoft.com...
> Hi,
> I have lots of files that contain macros that need to be changed. The
> changes are:
> - changing a textbox Lock from False to True
> - search and replace text in the macro
> - delete some text
>
> How can I loop through all these files and do the changes? The macro is
> protected with password.

This means you are stuck. There is no way to modify a VBA project using code
even if you know the password, unless you first use one of the password
cracking tools that are about on the internet to break the password
altogether.


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





Re: Changing macro using macro by UlfNilsson

UlfNilsson
Fri Nov 03 05:06:02 CST 2006

Sorry for being unclear. I have created the macro and I know the password.

/ Ulf

"Jonathan West" wrote:

>
> "Ulf Nilsson" <UlfNilsson@discussions.microsoft.com> wrote in message
> news:A2B87738-59AF-482F-AF0C-9B6720ED6DD6@microsoft.com...
> > Hi,
> > I have lots of files that contain macros that need to be changed. The
> > changes are:
> > - changing a textbox Lock from False to True
> > - search and replace text in the macro
> > - delete some text
> >
> > How can I loop through all these files and do the changes? The macro is
> > protected with password.
>
> This means you are stuck. There is no way to modify a VBA project using code
> even if you know the password, unless you first use one of the password
> cracking tools that are about on the internet to break the password
> altogether.
>
>
> --
> Regards
> Jonathan West - Word MVP
> www.intelligentdocuments.co.uk
> Please reply to the newsgroup
>
>
>
>
>

Re: Changing macro using macro by Jonathan

Jonathan
Fri Nov 03 06:18:32 CST 2006


"Ulf Nilsson" <UlfNilsson@discussions.microsoft.com> wrote in message
news:B5F623BD-9707-49AE-9D1B-FD3DD7168753@microsoft.com...
> Sorry for being unclear. I have created the macro and I know the password.
>

I realise that. You are still stuck, because there is no means available *in
code* to gain access to the VBProject object of a document or template if
the project has been password protected, even if you know the password.
Believe me, if there were a way, I would find it incredibly convenient to be
able to use it myself!


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



Re: Changing macro using macro by UlfNilsson

UlfNilsson
Sat Nov 04 12:30:02 CST 2006

Thanks anyway. At least I do not need to look any further. Just long hours
ahead of me to open each template and do the changes manually.

/ Ulf

"Jonathan West" wrote:

>
> "Ulf Nilsson" <UlfNilsson@discussions.microsoft.com> wrote in message
> news:B5F623BD-9707-49AE-9D1B-FD3DD7168753@microsoft.com...
> > Sorry for being unclear. I have created the macro and I know the password.
> >
>
> I realise that. You are still stuck, because there is no means available *in
> code* to gain access to the VBProject object of a document or template if
> the project has been password protected, even if you know the password.
> Believe me, if there were a way, I would find it incredibly convenient to be
> able to use it myself!
>
>
> --
> Regards
> Jonathan West - Word MVP
> www.intelligentdocuments.co.uk
> Please reply to the newsgroup
>
>
>

Re: Changing macro using macro by UlfNilsson

UlfNilsson
Tue Nov 07 03:06:01 CST 2006

Hi,
I found another solution:
Since I repeat the same movement and delete the same kind of code everytime,
I used a program called WinMacro to record my movements and deletion. The
program can be found at http://www.geocities.com/win_macro/.

This helped me.

/ Ulf



"Jonathan West" wrote:

>
> "Ulf Nilsson" <UlfNilsson@discussions.microsoft.com> wrote in message
> news:B5F623BD-9707-49AE-9D1B-FD3DD7168753@microsoft.com...
> > Sorry for being unclear. I have created the macro and I know the password.
> >
>
> I realise that. You are still stuck, because there is no means available *in
> code* to gain access to the VBProject object of a document or template if
> the project has been password protected, even if you know the password.
> Believe me, if there were a way, I would find it incredibly convenient to be
> able to use it myself!
>
>
> --
> Regards
> Jonathan West - Word MVP
> www.intelligentdocuments.co.uk
> Please reply to the newsgroup
>
>
>