Skip to main content

Search

Search

Send Email About Which Label, How Many Times And Data Source Is Printed

Comments

1 comment

  • Avatar
    Ian Cummings
    Moderator

    Yes this is possible.  Use a document level VB script and choose the OnPrintJobEnd event.  A quick Google search will turn up plenty of VBS code examples on how to do this.  Here is one I found that should at least give you a fair idea on how to approach this:

     

    Set emailObj      = CreateObject("CDO.Message")
    
    emailObj.From     = "dc@gail.com"
    emailObj.To       = "dc@gail.com"
    
    emailObj.Subject  = "Test CDO"
    emailObj.TextBody = "Test CDO"
    
    Set emailConfig = emailObj.Configuration
    
    emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
    emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
    emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing")    = 2  
    emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1  
    emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl")      = true 
    emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername")    = "YourUserName"
    emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword")    = "Password1"
    
    emailConfig.Fields.Update
    
    emailObj.Send
    
    If err.number = 0 then Msgbox "Done"
    
    0

Please sign in to leave a comment.