sporadic macro function

C

caverjay

I use the following code to automate the digital signing of word
documents. Most of my users use Word 2003, but some use 2007. This
doesn't work with 2007, it creates the file, but does not digitally
sign it. Occasionally, I have a user that states that it just does
not work (no error message). Any thoughts?

Private Sub Sign_Click()
Dim WshShell As Object
Dim SpecialPath As String
Dim Lvalue As String
Dim Sig As Signature
Dim MyOrt As String
Dim Doc As Object

Set WshShell = CreateObject("WScript.Shell")
SpecialPath = WshShell.SpecialFolders("Desktop")
Set Doc = ActiveDocument
Lvalue = Format(Date, "yyyymmdd")
MyOrt = InputBox("Initials")
Doc.SaveAs (SpecialPath & "\" & Lvalue & "-" & MyOrt & "-QAForm")


Set Sig = ActiveDocument.Signatures.Add
ActiveDocument.Signatures.Commit

MsgBox "File saved to desktop and signed."
End Sub
 

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