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 » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Strange Subject Line Behavior



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 11th 06, 10:22 PM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 8
Default Strange Subject Line Behavior

I have run across a strange problem. I have created a simple Outlook
2003 Add-in using VSTO in VS2005.

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.msoControlB utton,
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

Ads
  #2  
Old August 13th 06, 07:44 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Strange Subject Line Behavior

The control doesn't post the text until it loses focus.

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


wrote in message
ups.com...
I have run across a strange problem. I have created a simple Outlook
2003 Add-in using VSTO in VS2005.

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.msoControlB utton,
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


  #3  
Old August 14th 06, 03:17 PM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 8
Default Strange Subject Line Behavior

Is there any way to force that posting in code so as to accept whatever
text has been keyed?

Thanks,
Glen


Ken Slovak - [MVP - Outlook] wrote:
The control doesn't post the text until it loses focus.

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


wrote in message
ups.com...
I have run across a strange problem. I have created a simple Outlook
2003 Add-in using VSTO in VS2005.

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.msoControlB utton,
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


  #4  
Old August 14th 06, 04:07 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Strange Subject Line Behavior

Not that I know of but I've never tried. I'm sure you could do it with
plenty of Win32 API calls and hooking all messages to that rich text
control, a window under the primary email window.

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


wrote in message
ups.com...
Is there any way to force that posting in code so as to accept whatever
text has been keyed?

Thanks,
Glen


  #5  
Old August 14th 06, 06:06 PM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 8
Default Strange Subject Line Behavior

Thanks for the info. If I might trouble you further.

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:
Not that I know of but I've never tried. I'm sure you could do it with
plenty of Win32 API calls and hooking all messages to that rich text
control, a window under the primary email window.

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


wrote in message
ups.com...
Is there any way to force that posting in code so as to accept whatever
text has been keyed?

Thanks,
Glen


  #6  
Old August 15th 06, 12:17 AM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Strange Subject Line Behavior

Outlook 2003 has the same problems. Outlook 2007 seems to finally have fixed
that bug.

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


wrote in message
oups.com...
Thanks for the info. If I might trouble you further.

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


  #7  
Old August 15th 06, 03:30 PM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 8
Default Strange Subject Line Behavior

I have been trying to work through using AddInMon, but have not been
able to get it to work yet. The code included in the examples look
like VB6. Has anyone done this in VB.NET using VS2k5? I'm a beginner
with Outlook programming and seem to be in a bit over my head.

Should I be looking at modifying the main email form instead?

Thanks,
Glen


Ken Slovak - [MVP - Outlook] wrote:
Outlook 2003 has the same problems. Outlook 2007 seems to finally have fixed
that bug.

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


wrote in message
oups.com...
Thanks for the info. If I might trouble you further.

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


  #8  
Old August 15th 06, 08:14 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Strange Subject Line Behavior

AddInMon was written in VB 6. To my knowledge there have been no
translations into any other language, and we're not planning to update it
further. We've come up with an inline alternative to AddInMon (VB 6 only at
this point) that does better than AddInMon in handling all the variations
that come with different Outlook versions and ways Outlook starts with no
UI.

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


wrote in message
ps.com...
I have been trying to work through using AddInMon, but have not been
able to get it to work yet. The code included in the examples look
like VB6. Has anyone done this in VB.NET using VS2k5? I'm a beginner
with Outlook programming and seem to be in a bit over my head.

Should I be looking at modifying the main email form instead?

Thanks,
Glen


  #9  
Old August 15th 06, 08:41 PM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 8
Default Strange Subject Line Behavior

Ken,

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:
AddInMon was written in VB 6. To my knowledge there have been no
translations into any other language, and we're not planning to update it
further. We've come up with an inline alternative to AddInMon (VB 6 only at
this point) that does better than AddInMon in handling all the variations
that come with different Outlook versions and ways Outlook starts with no
UI.

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


wrote in message
ps.com...
I have been trying to work through using AddInMon, but have not been
able to get it to work yet. The code included in the examples look
like VB6. Has anyone done this in VB.NET using VS2k5? I'm a beginner
with Outlook programming and seem to be in a bit over my head.

Should I be looking at modifying the main email form instead?

Thanks,
Glen


  #10  
Old August 15th 06, 10:28 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Strange Subject Line Behavior

My book will probably be released around the end of the year, about when
Outlook 2007 is released.

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


wrote in message
oups.com...
Ken,

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


 




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
Office 2003 strange behavior Beauford Outlook - General Queries 5 August 1st 06 10:33 PM
Address book, strange behavior [email protected] Outlook and VBA 4 May 26th 06 11:56 PM
Strange calendar behavior Dan Outlook - Calandaring 1 February 25th 06 05:12 AM
Strange characters on Subject Line. ferg Outlook - General Queries 9 February 24th 06 07:09 PM
strange encryption behavior Larry Outlook - General Queries 0 January 24th 06 10:26 PM


All times are GMT +1. The time now is 12:57 PM.


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.