Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Add-Ins / November 2003

Tip: Looking for answers? Try searching our database.

Word as Email Editor/Inspectors/Commandbar

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David McNealey - 24 Nov 2003 21:27 GMT
I've created an plug-in for Outlook. It creates commandbars
on Mail Inspector items.

Here is my problem, whenever Word is used as my
editor/reader, I have the followin problems:

Words as my email editor:
I add a FlagRequest to the mailitem. However, the
FlagRequest does not show in the inspector. When I look
back on my main Outlook Explorer, the flag indicator is
displayed next to the item in the list. If I click on the
FlagRequest button on the inspector, I can see the values I
set for the FlagRequest. On FlagRequest dialog, if I press
the OK or Cancel button, the FlagRequest will now show on
the Inspector.

Word as to read Rich-Text emails:
I cannot create any Commandbars to the inspector. I just
get a very unimformative error message. I have read on
other sites that adding commandbars under this condition is
not possible. Is this true? Is this a bug in Outlook?
Ken Slovak - [MVP - Outlook] - 25 Nov 2003 15:02 GMT
You don't mention your version of Outlook, but forget about getting an
Inspector in Outlook 2000 when a WordMail item is opened.

It works in Outlook 2002 or 2003 but is still funky. In Outlook 2003 I
can get an Inspector and add a CommandBar to it but when an item is
sent in code the Inspector remains open unless you close the
Word.Document.ActiveWindow and discard it, and then when you exit
Outlook you get a prompt about saving Normal.Dot, which has been
modified by your adding and then deleting your CommandBar object.

--
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'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?
David McNealey - 25 Nov 2003 18:15 GMT
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?
- 25 Nov 2003 21:58 GMT
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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.