A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

FindControl Number ID to enable Digital Signature and Encryption



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 18th 08, 04:48 AM posted to microsoft.public.outlook.program_vba
LEH
external usenet poster
 
Posts: 3
Default FindControl Number ID to enable Digital Signature and Encryption

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  
Old January 18th 08, 04:54 AM posted to microsoft.public.outlook.program_vba
LEH
external usenet poster
 
Posts: 3
Default FindControl Number ID to enable Digital Signature and Encryption

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  
Old January 18th 08, 06:55 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default FindControl Number ID to enable Digital Signature and Encryption



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  
Old January 23rd 08, 12:26 AM posted to microsoft.public.outlook.program_vba
LEH
external usenet poster
 
Posts: 3
Default FindControl Number ID to enable Digital Signature and Encrypti

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 10:31 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.