> I've created an plug-in for Outlook. It creates commandbars
> on Mail Inspector items.
[quoted text clipped - 17 lines]
> other sites that adding commandbars under this condition is
> not possible. Is this true? Is this a bug in Outlook?
Thank you for your response. I am using Outlook 2003. I am
able to get the reference to the Inspector. However, I have
been unable to add the commandbar. Do you use a different
than the add method from the CommandBars object on the
inspector. Do you use the WordEditor object on the inspector?
Do you have a code example of how you added the commandbar?
Have you seen this issue I am having with the FlagRequest?
>-----Original Message-----
>You don't mention your version of Outlook, but forget about getting an
[quoted text clipped - 38 lines]
>
>.
Ken Slovak - [MVP - Outlook] - 25 Nov 2003 19:38 GMT
I just use the Inspector.CommandBars collection and add my button to
the "Standard" toolbar. Then I delete it when the Inspector closes
even though I instantiate it as temporary. I do have something of a
glitch when the Click event fires for the button, the instantiated
button object is Nothing at that point. I have to save any states I
want for it as module level variables and just access the Button
object passed in the Click event handler.
I access the WordEditor object as a Word.Document when I want to make
sure the Inspector will actually close. I get the Document's File menu
from the "Menu Bar" CommandBar and then execute the Exit menu item.
That way the orphaned Word pane isn't left sitting there after the
item is sent or whatever. Also, if the user has prompt for saving
Normal.dot enabled they will be prompted each time Outlook is closed.
I haven't found a way around that. Using 0 as an argument for the
Document or ActiveWindow in the Close method still prompts for saving
Normal.dot and the other things I've played with also don't prevent
that.
I haven't played with flag requests in the Word editor.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
> Thank you for your response. I am using Outlook 2003. I am
> able to get the reference to the Inspector. However, I have
[quoted text clipped - 5 lines]
>
> Have you seen this issue I am having with the FlagRequest?
I forgot to add this in, I only have this problem when the
email of type "Rich Text". Also, this problem only rears
itself when I am reading the email. I can create the
commandbars when I am on a composition (new, reply,
forward) email.
Thank you for your response. I am using Outlook 2003. I am
able to get the reference to the Inspector. However, I have
been unable to add the commandbar. Do you use a different
than the add method from the CommandBars object on the
inspector. Do you use the WordEditor object on the inspector?
Do you have a code example of how you added the commandbar?
Have you seen this issue I am having with the FlagRequest?
>-----Original Message-----
>Thank you for your response. I am using Outlook 2003. I am
[quoted text clipped - 58 lines]
>>
>.
Ken Slovak - [MVP - Outlook] - 26 Nov 2003 15:47 GMT
I haven't seen your FlagRequest problem, not sure what it is.
Here's some code I used to create a new toolbar button in the Standard
toolbar in a WordMail item in Outlook 2003. The code runs in an
Inspector wrapper class that is instantiated when NewInspector fires:
Private Sub CreateButtons(objInspector As Outlook.Inspector, _
blnNew As Boolean)
Dim cbStd As Office.CommandBar
Dim strToolbar As String
Dim strToolTip As String
Dim strMessage As String
Dim strEntryID As String
Dim strVCID As String
Dim strKBID As String
Dim strName As String
Dim blnEnabled As Boolean
Dim strKey As String
On Error Resume Next
'code to load a button image into the clipboard
'from a resource file, the procedure is not shown here
basOutlook.GetClipboard
If blnNew Then
Clipboard.SetData LoadResPicture(101, 0)
Else
Clipboard.SetData LoadResPicture(102, 0)
End If
strKey = CStr(m_lngID)
'Adding a button to the Standard toolbar for any Inspector
strToolbar = "Standard"
Set cbStd = objInspector.CommandBars(strToolbar)
'Do button
m_strTag = "MyButton" & strKey
strToolTip = "my button's tool tip text"
strMessage = "My Button"
Set cbbModuleLevelButtonObject = cbStd.FindControl(Tag:=m_strTag)
If Not (cbbModuleLevelButtonObject Is Nothing) Then
cbbModuleLevelButtonObject.Delete
Set cbbModuleLevelButtonObject = Nothing
End If
If cbbModuleLevelButtonObject Is Nothing Then
Err.Clear
Set cbbModuleLevelButtonObject =
cbStd.Controls.Add(Type:=msoControlButton, _
Parameter:=m_strTag, Temporary:=True)
With cbbModuleLevelButtonObject
.DescriptionText = strToolTip
.BeginGroup = True
.Caption = strMessage
.PasteFace 'add icon
.Tag = m_strTag
.ToolTipText = strToolTip
.Style = msoButtonIconAndCaption
'the following syntax is critical
.OnAction = "!<" & gstrProgID & ">"
.Visible = True
.Enabled = True
If m_ButtonState Then
.State = msoButtonDown
Else
.State = msoButtonUp
End If
End With
End If
Clipboard.Clear
basOutlook.RestoreClipboard
Set cbStd = Nothing
End Sub
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
> I forgot to add this in, I only have this problem when the
> email of type "Rich Text". Also, this problem only rears
[quoted text clipped - 11 lines]
>
> Have you seen this issue I am having with the FlagRequest?