PC Review


Reply
Thread Tools Rate Thread

Can not change email body content on Outlook 2010

 
 
Tom
Guest
Posts: n/a
 
      4th Jan 2010
Hi,

I've VBA sub to change content for incoming email. That works fine on
Outlook 2007 but not 2010. The VBA code is:

=============================================
Sub test()
Dim ns As NameSpace
Dim Inbox As MAPIFolder
Dim Item As Object

Set ns = GetNamespace("MAPI")
Set Inbox = ns.GetDefaultFolder(olFolderInbox)

Set Item = Inbox.Items.Item(1)

Item.Body = "Test" & Item.Body
End Sub
=============================================

After running the email content in Outlook 2007 add "Test" at the beginning
of the email. But in Outlook 2010 it does nothing.

Any suggestion? Thanks in advence!

Tom

 
Reply With Quote
 
 
 
 
Sue Mosher [MVP]
Guest
Posts: n/a
 
      4th Jan 2010
You need to call Item.Save after changing the item's content.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Tom" <(E-Mail Removed)> wrote in message
news:98795E66-6DD8-410F-B4A3-(E-Mail Removed)...
> Hi,
>
> I've VBA sub to change content for incoming email. That works fine on
> Outlook 2007 but not 2010. The VBA code is:
>
> =============================================
> Sub test()
> Dim ns As NameSpace
> Dim Inbox As MAPIFolder
> Dim Item As Object
>
> Set ns = GetNamespace("MAPI")
> Set Inbox = ns.GetDefaultFolder(olFolderInbox)
>
> Set Item = Inbox.Items.Item(1)
>
> Item.Body = "Test" & Item.Body
> End Sub
> =============================================
>
> After running the email content in Outlook 2007 add "Test" at the
> beginning
> of the email. But in Outlook 2010 it does nothing.
>
> Any suggestion? Thanks in advence!
>
> Tom
>



 
Reply With Quote
 
Tom
Guest
Posts: n/a
 
      5th Jan 2010
Thanks Sue! That's really help!

"Sue Mosher [MVP]" wrote:

> You need to call Item.Save after changing the item's content.
> --
> Sue Mosher, Outlook MVP
> Author of Microsoft Outlook 2007 Programming:
> Jumpstart for Power Users and Administrators
> http://www.outlookcode.com/article.aspx?id=54
>
>
> "Tom" <(E-Mail Removed)> wrote in message
> news:98795E66-6DD8-410F-B4A3-(E-Mail Removed)...
> > Hi,
> >
> > I've VBA sub to change content for incoming email. That works fine on
> > Outlook 2007 but not 2010. The VBA code is:
> >
> > =============================================
> > Sub test()
> > Dim ns As NameSpace
> > Dim Inbox As MAPIFolder
> > Dim Item As Object
> >
> > Set ns = GetNamespace("MAPI")
> > Set Inbox = ns.GetDefaultFolder(olFolderInbox)
> >
> > Set Item = Inbox.Items.Item(1)
> >
> > Item.Body = "Test" & Item.Body
> > End Sub
> > =============================================
> >
> > After running the email content in Outlook 2007 add "Test" at the
> > beginning
> > of the email. But in Outlook 2010 it does nothing.
> >
> > Any suggestion? Thanks in advence!
> >
> > Tom
> >

>
>
> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2007 missing body content of email Bahamianfish Microsoft Outlook Discussion 0 30th Dec 2009 06:28 AM
Outlook is attaching files in the body of email, I want to change lexnike Microsoft Outlook Discussion 3 22nd May 2008 07:24 AM
Change the email content an Outlook Form generates =?Utf-8?B?RGF2aWQ=?= Microsoft Outlook Discussion 1 9th Feb 2006 07:22 PM
Automatically create contact from email content/body? =?Utf-8?B?U2NvdHQgKEFUTCk=?= Microsoft Outlook Discussion 1 25th Mar 2004 01:53 PM
no content in the email body stephen Microsoft Outlook 2 7th Nov 2003 07:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:43 PM.