Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
developer
active.documents
automation
binary.file_format
clipboard.dde
com.add_ins
hosting.controls
internet_other
office.sdks
officedev
officedev.other
outlook.forms
outlook.vba
smarttags
vba
web.components
  
 
date: Fri, 16 May 2008 06:06:00 -0700,    group: microsoft.public.office.developer.com.add_ins        back       


How to add/remove attachments only for the Inspector   
Hi
I have to develop an add-in for Outlook 2003 using VSTO in C#.
I want to use the Inspector associated to an MailItem in order to add some 
attachments when the inspector is opened (NewInspector event) and remove 
these attachments when it is closed, handling MailItem_Close event.
Which is the best approach?
Thank you
date: Fri, 16 May 2008 06:06:00 -0700   author:   Pavel Rosoi

Re: How to add/remove attachments only for the Inspector   
I'd wait for the first Activate() event on the Inspector so that the 
Inspector and CurrentItem are fully instantiated as strong object references 
instead of the weak object references you get in NewInspector().

Then just use the usual Add() and Remove() methods to add and remove the 
attachments.

-- 
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Pavel Rosoi"  wrote in message 
news:3628B038-E877-41BC-882F-2C5D38AA64BD@microsoft.com...
> Hi
> I have to develop an add-in for Outlook 2003 using VSTO in C#.
> I want to use the Inspector associated to an MailItem in order to add some
> attachments when the inspector is opened (NewInspector event) and remove
> these attachments when it is closed, handling MailItem_Close event.
> Which is the best approach?
> Thank you
>
date: Fri, 16 May 2008 09:53:47 -0400   author:   Ken Slovak - [MVP - Outlook]

Re: How to add/remove attachments only for the Inspector   
Thank you
I use NewInspector event in order to have the Inspector reference.
Once the Activate() is fired, how do I obtain the Inspector reference? Via 
Application.ActiveInspector()?
When I close the Inspector I have “Do you want to save changes?" window and 
it seems to be correct because I still see the attachment and probably 
Outlook detects the change. How do I prevent that? I use MailItem Close() 
event for attachment removing.
Best regards


"Ken Slovak - [MVP - Outlook]" wrote:

> I'd wait for the first Activate() event on the Inspector so that the 
> Inspector and CurrentItem are fully instantiated as strong object references 
> instead of the weak object references you get in NewInspector().
> 
> Then just use the usual Add() and Remove() methods to add and remove the 
> attachments.
> 
> -- 
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Professional Programming Outlook 2007.
> Reminder Manager, Extended Reminders, Attachment Options.
> http://www.slovaktech.com/products.htm
> 
> 
> "Pavel Rosoi"  wrote in message 
> news:3628B038-E877-41BC-882F-2C5D38AA64BD@microsoft.com...
> > Hi
> > I have to develop an add-in for Outlook 2003 using VSTO in C#.
> > I want to use the Inspector associated to an MailItem in order to add some
> > attachments when the inspector is opened (NewInspector event) and remove
> > these attachments when it is closed, handling MailItem_Close event.
> > Which is the best approach?
> > Thank you
> > 
> 
>
date: Fri, 16 May 2008 07:44:00 -0700   author:   Pavel Rosoi

Re: How to add/remove attachments only for the Inspector   
I and many other people use Inspector wrappers in collections and 
instantiate a wrapper class in NewInspector(). That way the wrapper class 
knows its own Inspector and UI.

I have some samples of that at 
http://www.slovaktech.com/outlook_2007_templates.htm. Those are for Outlook 
2007 only. They illustrate how to handle all the things you're asking about.

-- 
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Pavel Rosoi"  wrote in message 
news:A3FA28DA-3E78-46E4-90A9-F62F68BC683B@microsoft.com...
> Thank you
> I use NewInspector event in order to have the Inspector reference.
> Once the Activate() is fired, how do I obtain the Inspector reference? Via
> Application.ActiveInspector()?
> When I close the Inspector I have “Do you want to save changes?" window 
> and
> it seems to be correct because I still see the attachment and probably
> Outlook detects the change. How do I prevent that? I use MailItem Close()
> event for attachment removing.
> Best regards
date: Mon, 19 May 2008 16:24:06 -0400   author:   Ken Slovak - [MVP - Outlook]

Re: How to add/remove attachments only for the Inspector   
Thank you for your answer.
I am able to add/remove attachments on the existing items, but I am 
wondering if it is possible to directly control the Inspector form, bypassing 
the item operations. 
If I use the MailItem.Attachements Add/Remove I modify the 
LastModificationTime property. 

There is an API which allows to directly controlling the Inspector form 
fields or any other way in order to put some supplementary information on the 
Inspector form but without touching the item?
Best regards


"Ken Slovak - [MVP - Outlook]" wrote:

> I and many other people use Inspector wrappers in collections and 
> instantiate a wrapper class in NewInspector(). That way the wrapper class 
> knows its own Inspector and UI.
> 
> I have some samples of that at 
> http://www.slovaktech.com/outlook_2007_templates.htm. Those are for Outlook 
> 2007 only. They illustrate how to handle all the things you're asking about.
> 
> -- 
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Professional Programming Outlook 2007.
> Reminder Manager, Extended Reminders, Attachment Options.
> http://www.slovaktech.com/products.htm
> 
> 
> "Pavel Rosoi"  wrote in message 
> news:A3FA28DA-3E78-46E4-90A9-F62F68BC683B@microsoft.com...
> > Thank you
> > I use NewInspector event in order to have the Inspector reference.
> > Once the Activate() is fired, how do I obtain the Inspector reference? Via
> > Application.ActiveInspector()?
> > When I close the Inspector I have “Do you want to save changes?" window 
> > and
> > it seems to be correct because I still see the attachment and probably
> > Outlook detects the change. How do I prevent that? I use MailItem Close()
> > event for attachment removing.
> > Best regards
> 
>
date: Wed, 21 May 2008 06:20:01 -0700   author:   Pavel Rosoi

Re: How to add/remove attachments only for the Inspector   
The Inspector is a window, a container. It's the Inspector.CurrentItem that 
would have attachments, recipients, subject, etc. You must modify the item 
if you want to play with its attachments, and any change to an item will of 
course change the LastModificationTime property. You can't do what you want.

-- 
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Pavel Rosoi"  wrote in message 
news:096CE954-BF59-4548-ADD7-04D078813F91@microsoft.com...
> Thank you for your answer.
> I am able to add/remove attachments on the existing items, but I am
> wondering if it is possible to directly control the Inspector form, 
> bypassing
> the item operations.
> If I use the MailItem.Attachements Add/Remove I modify the
> LastModificationTime property.
>
> There is an API which allows to directly controlling the Inspector form
> fields or any other way in order to put some supplementary information on 
> the
> Inspector form but without touching the item?
> Best regards
date: Wed, 21 May 2008 09:36:48 -0400   author:   Ken Slovak - [MVP - Outlook]

Re: How to add/remove attachments only for the Inspector   
Thank you Ken.
Best regards

"Ken Slovak - [MVP - Outlook]" wrote:

> I and many other people use Inspector wrappers in collections and 
> instantiate a wrapper class in NewInspector(). That way the wrapper class 
> knows its own Inspector and UI.
> 
> I have some samples of that at 
> http://www.slovaktech.com/outlook_2007_templates.htm. Those are for Outlook 
> 2007 only. They illustrate how to handle all the things you're asking about.
> 
> -- 
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Professional Programming Outlook 2007.
> Reminder Manager, Extended Reminders, Attachment Options.
> http://www.slovaktech.com/products.htm
> 
> 
> "Pavel Rosoi"  wrote in message 
> news:A3FA28DA-3E78-46E4-90A9-F62F68BC683B@microsoft.com...
> > Thank you
> > I use NewInspector event in order to have the Inspector reference.
> > Once the Activate() is fired, how do I obtain the Inspector reference? Via
> > Application.ActiveInspector()?
> > When I close the Inspector I have “Do you want to save changes?" window 
> > and
> > it seems to be correct because I still see the attachment and probably
> > Outlook detects the change. How do I prevent that? I use MailItem Close()
> > event for attachment removing.
> > Best regards
> 
>
date: Wed, 21 May 2008 07:14:01 -0700   author:   Pavel Rosoi

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us