When a new mail message inspector is opened, I add a button to the
inspector's command bar. This button simply appends some standard text
on the end of whatever subject line text is already there if it has not
already been done. I check to see if the standardized text is on the
end of subject. If it's not, I add it.
It's really rather simple and works great (even with multiple
inspectors open) except for one strange issue.
When I enter some text in the subject line, if I DON'T exit the subject
textbox, whatever text I've entered doesn't show up in the mail message
object. So, when I go to add the standard text, whatever text I've
already keyed isn't there and my code erases it when it resets the
subject textbox.
If I key in some text and EXIT the subject textbox, then, when I click
the button, the mail object sees the text just fine and appends the
standard text to it as it should.
Has anyone else seen this behavior? It seems that the text in the
subject line textbox is not available to the mail message object until
you exit the field.
Any help or information would be greatly appreciated.
Sincerely,
Glen Wolinsky
Code Below
---------------------------
Public Class ThisApplication
Const PRIV_TEXT As String = " - Confidential Attorney Work Product
- Subject to Privilege"
Private WithEvents confidentialButton As Office.CommandBarButton
Private WithEvents olInspectors As Outlook.Inspectors =
Me.Inspectors
Private Sub ThisApplication_Startup(ByVal sender As Object, ByVal e
As System.EventArgs) Handles Me.Startup
End Sub
Private Sub ThisApplication_Shutdown(ByVal sender As Object, ByVal
e As System.EventArgs) Handles Me.Shutdown
End Sub
Private Sub NewInspector(ByVal insp As Outlook.Inspector) Handles
olInspectors.NewInspector
If TypeOf (insp.CurrentItem) Is Outlook.MailItem Then
Dim bar As Office.CommandBar = insp.CommandBars("Standard")
confidentialButton =
bar.Controls.Add(Office.MsoControlType.msoControlButton,
Temporary:=True)
With confidentialButton
.Caption = "Privilaged Tag"
.Style = MsoButtonStyle.msoButtonCaption
AddHandler .Click, AddressOf confidentialButton_Click
End With
End If
End Sub
Private Sub confidentialButton_Click(ByVal Ctrl As
Microsoft.Office.Core.CommandBarButton, ByRef CancelDefault As Boolean)
Dim draft As Outlook.MailItem =
DirectCast(ActiveInspector.CurrentItem, Outlook.MailItem)
If Not draft.Subject.EndsWith(PRIV_TEXT) Then
draft.Subject = Trim(draft.Subject) & PRIV_TEXT
End If
End Sub
End Class
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
<gwol...@millermartin.com> wrote in message
news:1155327744.1...@75g2000cwc.googlegroups.com...
Thanks,
Glen
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
<gwol...@millermartin.com> wrote in message
news:1155561428.2...@75g2000cwc.googlegroups.com...
This add-in has created a problem. We have a document management
system (MailSite from iManage) that integrates with Outlook 2003. You
can view and manipulate documents in the system from the OL2k3
interface. When you open a doc to view it, it checks it out. If you
haven't edited it, then when you exit OL it checks it back in.
When I load my add-in, that check-in never takes place. I'm assuming
that the problem is related to the known issue for which AddInMon was
created. The AddInMon information mentions using it for OL2k and OL2k2
but do I need this solution for OL2k3?
Thanks,
Glen
Ken Slovak - [MVP - Outlook] wrote:
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
<gwol...@millermartin.com> wrote in message
news:1155571582.4...@i42g2000cwa.googlegroups.com...
Should I be looking at modifying the main email form instead?
Thanks,
Glen
Ken Slovak - [MVP - Outlook] wrote:
The inline replacement has not been released yet. I'm adapting it to VB.NET
and C# and plan to release the templates in conjunction with my Outlook 2007
programming book (although parenthetically Outlook 2007 solves the
OnDisconnection won't fire problem).
My opinion is that I avoid the use of custom forms unless they are
absolutely necessary. Custom forms are a less than robust solution and are
prone to forms cache corruption and various other problems. In all cases,
unless my client drags me there kicking and screaming, I do everything in
COM addins and avoid forms like the plague. Your mileage might vary.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
<gwol...@millermartin.com> wrote in message
news:1155648623....@i3g2000cwc.googlegroups.com...
Your response begs the question: When do you plan on your Outlook 2007
book coming out? Or, is it possible to get your inline adaptation any
sooner?
We will not be going to OL2k7 for quite some time and some of our
attorneys REALLY want this feature.
Thanks,
Glen
Ken Slovak - [MVP - Outlook] wrote:
As I said, I don't plan to release the inline templates for VB/VB.NET/C#
until the book comes out.
AddInMon still works in most scenarios and can be used as is and downloaded
from the Microeye Web site. The calls to AddInMon use VB 6 code but there's
nothing to stop you from translating those calls into VB.Net or other
language of your choice. The source for that is only a few lines and the
source is available.
AddInMon is only available as an EXE and the source is filled with Win32 API
calls that wouldn't really translate into .NET code anyway.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
<gwol...@millermartin.com> wrote in message
news:1155667306.4...@h48g2000cwc.googlegroups.com...
Thanks,
Glen