Adding Signature to the end of Word document and sign it

bradyboyy88

Well-known Member
Joined
Feb 25, 2015
Messages
562
I am working on some code in excel vba and trying to open a word document, then add a signature to the bottom, sign it, then export it as as pdf. So far here is what I have:

Code:
Sub ExportSignedPDF
    'Open Word Doc 
    Dim WordApp As Word.Application
    Dim WordDoc As Word.Document
    Set WordApp = CreateObject("Word.Application")
    Set WordDoc = WordApp.Documents.Open("c:/user/blahblah.docx")
    Dim n As Long
    
    'Delete any comments
    Dim oComments As Object
    Set oComments = WordDoc.Comments
    
    For n = oComments.Count To 1 Step -1
        oComments(n).Delete
    Next 'n

   'Add signature and sign it with user information -- Need Help



    'Remove track changes
    WordDoc.Revisions.AcceptAll
  
    'Create PDF -- Need Help


    WordApp.Documents.Save 
    WordApp.Quit 
        
    Set oComments = Nothing
    Set WordDoc = Nothing
    Set WordApp = Nothing

End Sub

I am using the following methodology to add the signature but the problem is it requires the user to hit enter to verify the details. Is there a method to do that automatically?

Code:
Sub Macro1()
    Dim mysignature1 As Signature
    Set mysignature1 = ActiveDocument.Signatures.AddSignatureLine("{00000000-0000-0000-0000-000000000000}")
    mysignature1.Setup.SuggestedSigner = "Name"
    mysignature1.Setup.SuggestedSignerLine2 = "Project Manager"
    mysignature1.Setup.SuggestedSignerEmail = "email@domain.com"
    
End Sub
 
Last edited by a moderator:

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top