Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2005

Tip: Looking for answers? Try searching our database.

programmatically signa vba project

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Herve cadieu - 07 Nov 2005 14:51 GMT
Dear all,
i would like to know if there is a mean to sign programmatically some vba
macros embeded within a document so that the recipient will be prompted to
trust the project and allow the activation of the code even if the security
is set to High in his host application.

In fact I produce documents with a template and I embed some routines by
code to this document to offer extended functions to check digital signature
status of the document.
To achieve that I need to embed some routines in the document itself but
when opening on another computer the macros are disabled by default.
The solution should be to programmatically sign the VBA project before
applying the digital signature to the document itself so that both macros and
document are signed.
Anyone has an idea if it is possible ? I have cruised ver the VBIDE objects
but I cannot figure out how it could be done by code ? (if possible ?)
Thank you for your inputs
Best regards
Jonathan West - 07 Nov 2005 15:26 GMT
As far as I'm aware, there is no means to use code to digitally sign a VBA
project.

What you can do (provided you have the appropriate digital signature
available) is add code to an existing signed project, either by using the
VBE object or the OrganizerCopy method.

The way you could handle this in your application would be to open an
existing blank document which you have signed, add the necessary code and
content to it, then save it under a new name. All that can be done
programmatically.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

> Dear all,
> i would like to know if there is a mean to sign programmatically some vba
[quoted text clipped - 18 lines]
> Thank you for your inputs
> Best regards
Herve cadieu - 07 Nov 2005 20:23 GMT
Dear Jonathan ,
Thank you much for your input.
Can you tell me more about how to load an empty project holding signed
macros to establish the new document with embeded smartness?
Could you provide me a skeleton of code snippet ?

You can see about my authenticated Grapho-Lock documents on the web by
searching grapho-lock with google.
I make the pond over the bond between dynamically verified handwritten
signature and digital signature...
thank you in advance
Grapho-lock@noos.fr for additionnal discussions

> As far as I'm aware, there is no means to use code to digitally sign a VBA
> project.
[quoted text clipped - 30 lines]
> > Thank you for your inputs
> > Best regards
Jonathan West - 08 Nov 2005 11:33 GMT
Hi Herve,

You might need to have the document pre-loaded with a dummy module that
contains nothing but a comment or two, just so there is a VBA project
present for you to sign.

You can then use the OrganizerCopy method to copy modules from other
templates. You can look up the OrganizerCopy method in the VBA Help.

One thing you must be aware of - both the source and destination files must
not have no password protection on their VBA projects. If either file has a
VBA project password, OrganizerCopy (and any other method of transferring
code) will fail.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

> Dear Jonathan ,
> Thank you much for your input.
[quoted text clipped - 49 lines]
>> > Thank you for your inputs
>> > Best regards
Herve cadieu - 08 Nov 2005 14:48 GMT
Thank you much Jonathan
Ok I undestand now  why my code was not embeded with ! it is beacuse I was
setting a password in the vba project...
Ok then
and what about with a com  add-in ?
Should it be possible from a com add-in as far as you know ?
What if I was trying to derive from the main object application ?

sincerely
herve  

> Hi Herve,
>
[quoted text clipped - 63 lines]
> >> > Thank you for your inputs
> >> > Best regards
Jonathan West - 08 Nov 2005 15:17 GMT
I can't think how a COM add-in could possibly be of any help to you in this
case. You can't import or export VBA modules from a COM add-in.

I have to say that overall I think this whole approach is very problematical
and I doubt you are going to get it to work. How about you describe in
simple terms what you are trying to achieve. We might be able to think of a
completely different approach.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

> Thank you much Jonathan
> Ok I undestand now  why my code was not embeded with ! it is beacuse I was
[quoted text clipped - 83 lines]
>> >> > Thank you for your inputs
>> >> > Best regards
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.