Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: Can I use PropertyAccessor in Outlook 2007 to add x-headers?

Geek News

Can I use PropertyAccessor in Outlook 2007 to add x-headers?
"Jeff Graves" <jeffnewsgroups[ at ]orcsweb.com> 4/5/2007 6:07:45 PM
I know I *can* use Redemption to do this, but I've been able to do
everything else I needed to without using Redemption, so I'm hoping I
can overcome this last obstacle without having to use Redemption.
According to the docs:

http://msdn2.microsoft.com/en-us/library/bb226714.aspx#officeoutlook2007whatsnewdeveloperspart2__propertyaccessor

It looks like the PropertyAccessor is where I need to be to add this,
but the code below isn't working:

Private Sub Custom_ItemSend(ByVal oItem As Object, ByRef Cancel As
Boolean) Handles Application.ItemSend
Try
oItem.PropertyAccessor.SetProperty("http://
schemas.microsoft.com/mapi/string/{00020386-0000-0000-
C000-000000000046}/x-testheader", 12345)
oItem.Save()
Catch ex As Exception
Debug.Print(ex.Message)
End Try
End Sub

The message is sent and doesn't throw an exception but the x-header
isn't there. Any ideas here?

Re: Can I use PropertyAccessor in Outlook 2007 to add x-headers?
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 4/5/2007 8:45:42 PM
Can you see that propety later with OutlookSpy or MFCMAPI?
The property needsto be a string, but you are passing an int: replace 12345
with "12345".

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Jeff Graves" <jeffnewsgroups[ at ]orcsweb.com> wrote in message
news:1175796465.829236.29620[ at ]n76g2000hsh.googlegroups.com...
[Quoted Text]
>I know I *can* use Redemption to do this, but I've been able to do
> everything else I needed to without using Redemption, so I'm hoping I
> can overcome this last obstacle without having to use Redemption.
> According to the docs:
>
> http://msdn2.microsoft.com/en-us/library/bb226714.aspx#officeoutlook2007whatsnewdeveloperspart2__propertyaccessor
>
> It looks like the PropertyAccessor is where I need to be to add this,
> but the code below isn't working:
>
> Private Sub Custom_ItemSend(ByVal oItem As Object, ByRef Cancel As
> Boolean) Handles Application.ItemSend
> Try
> oItem.PropertyAccessor.SetProperty("http://
> schemas.microsoft.com/mapi/string/{00020386-0000-0000-
> C000-000000000046}/x-testheader", 12345)
> oItem.Save()
> Catch ex As Exception
> Debug.Print(ex.Message)
> End Try
> End Sub
>
> The message is sent and doesn't throw an exception but the x-header
> isn't there. Any ideas here?
>


Re: Can I use PropertyAccessor in Outlook 2007 to add x-headers?
"Jeff Graves" <jeffnewsgroups[ at ]orcsweb.com> 4/5/2007 9:30:48 PM
On Apr 5, 4:45 pm, "Dmitry Streblechenko" <dmi...[ at ]dimastr.com> wrote:
[Quoted Text]
> Can you see that propety later with OutlookSpy or MFCMAPI?
> The property needsto be a string, but you are passing an int: replace 12345
> with "12345".
>
> Dmitry Streblechenko (MVP)http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "Jeff Graves" <jeffnewsgro...[ at ]orcsweb.com> wrote in message
>
> news:1175796465.829236.29620[ at ]n76g2000hsh.googlegroups.com...
>
>
>
> >I know I *can* use Redemption to do this, but I've been able to do
> > everything else I needed to without using Redemption, so I'm hoping I
> > can overcome this last obstacle without having to use Redemption.
> > According to the docs:
>
> >http://msdn2.microsoft.com/en-us/library/bb226714.aspx#officeoutlook2...
>
> > It looks like the PropertyAccessor is where I need to be to add this,
> > but the code below isn't working:
>
> > Private Sub Custom_ItemSend(ByVal oItem As Object, ByRef Cancel As
> > Boolean) Handles Application.ItemSend
> > Try
> > oItem.PropertyAccessor.SetProperty("http://
> > schemas.microsoft.com/mapi/string/{00020386-0000-0000-
> > C000-000000000046}/x-testheader", 12345)
> > oItem.Save()
> > Catch ex As Exception
> > Debug.Print(ex.Message)
> > End Try
> > End Sub
>
> > The message is sent and doesn't throw an exception but the x-header
> > isn't there. Any ideas here?- Hide quoted text -
>
> - Show quoted text -

Dmitry,

That was it ... I wasn't sending a string value. As soon as I put
quotes around it, it showed up on the client. Thanks for your help!

Jeff

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net