Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add digital signature to Word Doc via VBA

Status
Not open for further replies.

mintjulep

Technical User
Aug 20, 2004
1,551
JP
I'm trying to add a digital signature to a Word document via VBA.

So far the closest I have been able to to come is:

Target.Signatures.AddNonVisibleSignature

This displays the digital signature dialog so that the user can manually select the certificate to use and apply the digital signature.

I want to accomplish this without manual intervention. But so far I've been unable to find the right combination of things in the object model to accomplish this.

The object model for signatures seems obtuse to me, and Word's built-in help and MS online resources document various properties and methods that do not appear to actually exist in the current implementation.

 
Mint,

Just throwing out a thought. If you were to add a DS manually, then, using the Watch Window as an exploration tool in debug, select the DS to identify what they are if you are able.


How to use the Watch Window as a Power Programming Tool faq707-4594
 
Great idea Skip.

I can see there are some properties that seem of interest. Need to look closer later.

But at first glance there seems to be a Catch-22 problem now.

None of the properties exist until the Digital Signature exists - obviously.

And while the properties are read/write, writing to change them after they exist is considered an edit, and editing a digitally signed document invalidates the signature.

So it seems that I need to figure out how to add a signature and set the properties simultaniously.
 
I can't see a way to get there, but I'd be happy if someone could show me something that I might be missing.

Once a signature is created all of the properties are available. They can be read without problem. But if you try to modify them they are read-only, or "access denied", or if you can can modify them then doing so invalidates the signature.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top