![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Our company has added two icons to the commandbar to expedite the selection
of Digital Signature and Encryption. I am using some code (see below) from MS that should "Select" or depress the Digital Signature icon / button. Unfortunately nothing happens when the code runs. Could the id number be wrong? If so how do I determine the id? This code is launched from an Access form: ' Create the Outlook session. Set objOutlook = CreateObject("Outlook.Application") ' Create the message. Set objOutlookMsg = objOutlook.CreateItem(olMailItem) With objOutlookMsg ' Add the To recipient(s) to the message. Set objOutlookRecip = .Recipients.Add(Me!emailaddress) objOutlookRecip.Type = olTo ' Add the CC recipient(s) to the message. 'Set objOutlookRecip = .Recipients.Add("Michael Suyama") 'objOutlookRecip.Type = olCC ' Add the BCC recipient(s) to the message. 'Set objOutlookRecip = .Recipients.Add("Andrew Fuller") 'objOutlookRecip.Type = olBCC ' Set the Subject, Body, and Importance of the message. .Subject = "Timecard for Period Ending " & Me!Date1 .Body = strBody .Importance = olImportanceHigh 'High importance .VotingOptions = "Approved;Disapproved" retVal = Item_Send(objOutlookMsg) ' Add attachments to the message. If Not IsMissing(AttachmentPath) Then Set objOutlookAttach = .Attachments.Add(AttachmentPath) End If ' Resolve each Recipient's name. For Each objOutlookRecip In .Recipients objOutlookRecip.Resolve Next .Display ' Should we display the message before sending? 'If DisplayMsg Then ' .Display 'Else '.Save '.Send 'End If End With Set objOutlook = Nothing This is the function called above: Function Item_Send(item) Dim oDigSignctl Dim oCBs On Error Resume Next Set oDigSignctl = item.GetInspector.CommandBars.FindControl(, 719) If oDigSignctl Is Nothing Then ' Add the toolbar button to the item. Set oCBs = item.GetInspector.CommandBars Set oDigSignctl = oCBs.item("Standard").Controls.Add(, 719, , , True) End If ' Check to make sure the button is not dimmed. If oDigSignctl.Enabled = True Then ' Check to make sure the button is not depressed. If oDigSignctl.State = 0 Then oDigSignctl.Execute Else MsgBox "You do not have a digital signature! " & _ "This mail will not be sent." ' Cancel the send to only allow sending of signed mail. Item_Send = False Exit Function End If Set oCBs = Nothing Set oDigSignctl = Nothing End Function Thanks for taking the time to respond! |
#2
|
|||
|
|||
![]()
To clarify a little - The icons are on the standard Outlook form used to send
a new email. "LEH" wrote: Our company has added two icons to the commandbar to expedite the selection of Digital Signature and Encryption. I am using some code (see below) from MS that should "Select" or depress the Digital Signature icon / button. Unfortunately nothing happens when the code runs. Could the id number be wrong? If so how do I determine the id? This code is launched from an Access form: ' Create the Outlook session. Set objOutlook = CreateObject("Outlook.Application") ' Create the message. Set objOutlookMsg = objOutlook.CreateItem(olMailItem) With objOutlookMsg ' Add the To recipient(s) to the message. Set objOutlookRecip = .Recipients.Add(Me!emailaddress) objOutlookRecip.Type = olTo ' Add the CC recipient(s) to the message. 'Set objOutlookRecip = .Recipients.Add("Michael Suyama") 'objOutlookRecip.Type = olCC ' Add the BCC recipient(s) to the message. 'Set objOutlookRecip = .Recipients.Add("Andrew Fuller") 'objOutlookRecip.Type = olBCC ' Set the Subject, Body, and Importance of the message. .Subject = "Timecard for Period Ending " & Me!Date1 .Body = strBody .Importance = olImportanceHigh 'High importance .VotingOptions = "Approved;Disapproved" retVal = Item_Send(objOutlookMsg) ' Add attachments to the message. If Not IsMissing(AttachmentPath) Then Set objOutlookAttach = .Attachments.Add(AttachmentPath) End If ' Resolve each Recipient's name. For Each objOutlookRecip In .Recipients objOutlookRecip.Resolve Next .Display ' Should we display the message before sending? 'If DisplayMsg Then ' .Display 'Else '.Save '.Send 'End If End With Set objOutlook = Nothing This is the function called above: Function Item_Send(item) Dim oDigSignctl Dim oCBs On Error Resume Next Set oDigSignctl = item.GetInspector.CommandBars.FindControl(, 719) If oDigSignctl Is Nothing Then ' Add the toolbar button to the item. Set oCBs = item.GetInspector.CommandBars Set oDigSignctl = oCBs.item("Standard").Controls.Add(, 719, , , True) End If ' Check to make sure the button is not dimmed. If oDigSignctl.Enabled = True Then ' Check to make sure the button is not depressed. If oDigSignctl.State = 0 Then oDigSignctl.Execute Else MsgBox "You do not have a digital signature! " & _ "This mail will not be sent." ' Cancel the send to only allow sending of signed mail. Item_Send = False Exit Function End If Set oCBs = Nothing Set oDigSignctl = Nothing End Function Thanks for taking the time to respond! |
#3
|
|||
|
|||
![]() You would add your own button with a unique name; pass that as the third parameter to the Add function. Also, use FindControl with that name for the third paramter. If you want to know button IDs, Outlook Spy from www.dimastr.com is very useful. -- Best regards Michael Bauer - MVP Outlook Synchronize Outlook Categories: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Thu, 17 Jan 2008 20:48:00 -0800 schrieb LEH: Our company has added two icons to the commandbar to expedite the selection of Digital Signature and Encryption. I am using some code (see below) from MS that should "Select" or depress the Digital Signature icon / button. Unfortunately nothing happens when the code runs. Could the id number be wrong? If so how do I determine the id? This code is launched from an Access form: ' Create the Outlook session. Set objOutlook = CreateObject("Outlook.Application") ' Create the message. Set objOutlookMsg = objOutlook.CreateItem(olMailItem) With objOutlookMsg ' Add the To recipient(s) to the message. Set objOutlookRecip = .Recipients.Add(Me!emailaddress) objOutlookRecip.Type = olTo ' Add the CC recipient(s) to the message. 'Set objOutlookRecip = .Recipients.Add("Michael Suyama") 'objOutlookRecip.Type = olCC ' Add the BCC recipient(s) to the message. 'Set objOutlookRecip = .Recipients.Add("Andrew Fuller") 'objOutlookRecip.Type = olBCC ' Set the Subject, Body, and Importance of the message. .Subject = "Timecard for Period Ending " & Me!Date1 .Body = strBody .Importance = olImportanceHigh 'High importance .VotingOptions = "Approved;Disapproved" retVal = Item_Send(objOutlookMsg) ' Add attachments to the message. If Not IsMissing(AttachmentPath) Then Set objOutlookAttach = .Attachments.Add(AttachmentPath) End If ' Resolve each Recipient's name. For Each objOutlookRecip In .Recipients objOutlookRecip.Resolve Next .Display ' Should we display the message before sending? 'If DisplayMsg Then ' .Display 'Else '.Save '.Send 'End If End With Set objOutlook = Nothing This is the function called above: Function Item_Send(item) Dim oDigSignctl Dim oCBs On Error Resume Next Set oDigSignctl = item.GetInspector.CommandBars.FindControl(, 719) If oDigSignctl Is Nothing Then ' Add the toolbar button to the item. Set oCBs = item.GetInspector.CommandBars Set oDigSignctl = oCBs.item("Standard").Controls.Add(, 719, , , True) End If ' Check to make sure the button is not dimmed. If oDigSignctl.Enabled = True Then ' Check to make sure the button is not depressed. If oDigSignctl.State = 0 Then oDigSignctl.Execute Else MsgBox "You do not have a digital signature! " & _ "This mail will not be sent." ' Cancel the send to only allow sending of signed mail. Item_Send = False Exit Function End If Set oCBs = Nothing Set oDigSignctl = Nothing End Function Thanks for taking the time to respond! |
#4
|
|||
|
|||
![]()
OK we'll give that a shot - Thanks for taking the time to respond!
"Michael Bauer [MVP - Outlook]" wrote: You would add your own button with a unique name; pass that as the third parameter to the Add function. Also, use FindControl with that name for the third paramter. If you want to know button IDs, Outlook Spy from www.dimastr.com is very useful. -- Best regards Michael Bauer - MVP Outlook Synchronize Outlook Categories: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Thu, 17 Jan 2008 20:48:00 -0800 schrieb LEH: Our company has added two icons to the commandbar to expedite the selection of Digital Signature and Encryption. I am using some code (see below) from MS that should "Select" or depress the Digital Signature icon / button. Unfortunately nothing happens when the code runs. Could the id number be wrong? If so how do I determine the id? This code is launched from an Access form: ' Create the Outlook session. Set objOutlook = CreateObject("Outlook.Application") ' Create the message. Set objOutlookMsg = objOutlook.CreateItem(olMailItem) With objOutlookMsg ' Add the To recipient(s) to the message. Set objOutlookRecip = .Recipients.Add(Me!emailaddress) objOutlookRecip.Type = olTo ' Add the CC recipient(s) to the message. 'Set objOutlookRecip = .Recipients.Add("Michael Suyama") 'objOutlookRecip.Type = olCC ' Add the BCC recipient(s) to the message. 'Set objOutlookRecip = .Recipients.Add("Andrew Fuller") 'objOutlookRecip.Type = olBCC ' Set the Subject, Body, and Importance of the message. .Subject = "Timecard for Period Ending " & Me!Date1 .Body = strBody .Importance = olImportanceHigh 'High importance .VotingOptions = "Approved;Disapproved" retVal = Item_Send(objOutlookMsg) ' Add attachments to the message. If Not IsMissing(AttachmentPath) Then Set objOutlookAttach = .Attachments.Add(AttachmentPath) End If ' Resolve each Recipient's name. For Each objOutlookRecip In .Recipients objOutlookRecip.Resolve Next .Display ' Should we display the message before sending? 'If DisplayMsg Then ' .Display 'Else '.Save '.Send 'End If End With Set objOutlook = Nothing This is the function called above: Function Item_Send(item) Dim oDigSignctl Dim oCBs On Error Resume Next Set oDigSignctl = item.GetInspector.CommandBars.FindControl(, 719) If oDigSignctl Is Nothing Then ' Add the toolbar button to the item. Set oCBs = item.GetInspector.CommandBars Set oDigSignctl = oCBs.item("Standard").Controls.Add(, 719, , , True) End If ' Check to make sure the button is not dimmed. If oDigSignctl.Enabled = True Then ' Check to make sure the button is not depressed. If oDigSignctl.State = 0 Then oDigSignctl.Execute Else MsgBox "You do not have a digital signature! " & _ "This mail will not be sent." ' Cancel the send to only allow sending of signed mail. Item_Send = False Exit Function End If Set oCBs = Nothing Set oDigSignctl = Nothing End Function Thanks for taking the time to respond! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Digital Signature Certificate | Andy Derbyshire | Outlook - General Queries | 1 | January 11th 08 12:44 PM |
Turn off Digital Signature | woodsdarren | Outlook and VBA | 3 | October 24th 07 03:00 PM |
Digital Signature Warning Msg | Rich in Yorktown | Outlook and VBA | 0 | December 29th 06 12:42 PM |
How to format the telephone number in digital signature to all? | Gladius | Outlook - General Queries | 0 | November 20th 06 07:13 PM |
Digital ID and automatic encryption to certain contacts | Fredly | Outlook - General Queries | 1 | January 23rd 06 10:21 PM |