[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Outlook - Subject Change Vb.net

Posted on 2012-04-09
4
Medium Priority
?
644 Views
Last Modified: 2012-08-02
'http://www.codeproject.com/Articles/13439/Extracting-mails-and-attachments-from-outlook-2003

I got this code snippet from the above site.
 Dim objOL As Application
        Dim objNS As Outlook.NameSpace
        Dim myItems As Items
        Dim x As Int16

        objOL = New Application()
        objNS = objOL.GetNamespace("MAPI")

        Dim olfolder As MAPIFolder
        olfolder = objOL.GetNamespace("MAPI").GetDefaultFolder(OlDefaultFolders.olFolderInbox)

        myItems = olfolder.Items

        For x = myItems.Count To 1 Step -1
            If myItems.Item(x).To.ToString.Contains("Username") Then
                MsgBox(myItems.Item(x).SenderName)
                MsgBox(myItems.Item(x).Subject)
            End If
        Next x

Open in new window


However, what I want to do is when it meets the condition of the to field containts what ever the user's name is, I want it to change the subject of the item (in outlook 2010/2007) to

"In progress " + what ever the original subject name was.

So the part I don't know how to do is the change subject name to something different. Can anyone help me in this please.

Thanks.
0
Comment
Question by:BoltonWanderer
3 Comments
 

Accepted Solution

by:
BoltonWanderer earned 0 total points
ID: 37823207
Just tried something. Is it this simple.

 
Dim oldsub = myItems.Item(x).Subject
            myItems.Item(x).Subject = "In Progress" & oldsub 
            myItems.Item(x).Save()

Open in new window

0
 
LVL 32

Assisted Solution

by:Robberbaron (robr)
Robberbaron (robr) earned 2000 total points
ID: 37827101
yes it should be as Subject is  a writable property. http://msdn.microsoft.com/en-us/library/bb176688%28v=office.12%29.aspx

My experience is with CDO / MAPI but works the same.  http://oreilly.com/catalog/cdomapi/chapter/ch07.html  has a writable subject.

read the part about object instantiation as well.
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 38249581
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question