[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Outlook form to modify subject line

Posted on 2015-01-19
8
Medium Priority
?
1,150 Views
Last Modified: 2015-01-26
I need to create a outlook email form that will allow a user to type in a project number, then when the message is sent, append it to the subject line.

So, to be clear...
1. User starts new email and form pops up (this would replace the standard email form)
2.  Only difference in email form is that  before the Subject line, there is a line named Project #.
3. they type in a project number then fill out the subject and the body of the email and send normally.

When sent, the subject is modified to include the project number: Example: 110211 - Project update

Please let me know if this is possible.
0
Comment
Question by:blkstrim
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 37

Expert Comment

by:bbao
ID: 40559212
it is technically possible. what you do is to create a custom Outlook form using VBA for Outlook.

there is a good blog post giving great details about this. check below link.

https://www.add-in-express.com/creating-addins-blog/2013/04/24/creating-custom-outlook-forms/

this applies to Outlook 2007, 2010 and 2013.
0
 
LVL 76

Accepted Solution

by:
David Lee earned 2000 total points
ID: 40559898
Hi, blkstrim.

As @bbao has already said, yes, this is possible.  All you need to do is

1.  Create the form  The link @bbao provided has details on how to do that.  In short, you'll create a new form based on the standard message form.  With that new form open in the form designer add your custom field to it.

2.  Add code (VBscript) behind the form to prepend the project number to the subject.  The code for that will look something like this.

Sub Item_Send()
    Dim olkIns, olkPag, olkCtl
    Set olkIns = Item.GetInspector
    Set olkPag = olkIns.ModifiedFormPages("Message")
    Set olkCtl = olkPag.Controls("txtProjNum")
    Item.Subject = olkCtl.Value & " " & item.Subject
    Item.Save
    Set olkCtl = Nothing
    Set olkPag = Nothing
    Set olkIns = Nothing
End Sub

Open in new window


This code presumes that you named the control you'll enter the project number into "txtProjNum".  If you call it something else, then change "txtProjNum" to whatever name you use.  Note that the name cannot contain any spaces.  

3.  Once you've created the form and added the code you'll need to publish the form.  If you're going to be the only person using this form, then you can publish it to your personal forms library.  If there's a wider audience that needs to use the form, then you'll either need to publish it to each of their personal forms libararies or publish it to the organizational forms library.  The latter will probably require assistance from your email admin.
0
 

Author Comment

by:blkstrim
ID: 40560099
Hi, BlueDevilFan.

I created the form from the standard message form and added my textbox, which I named txtProjNum. I then added the code and published the form. The issue that I am having is the it is showing the same information in both the subject and Project number lines. When the message is sent, it is doubling the subject. Example:
I enter a Subject as: Testing
Tabbing or clicking to the Project # box, it is populated with Testing. If I add anything to it both the subject and Project # lines update and mirror each other.
When the message is sent, the Subject appears (using the sample above) as Testing Testing

How do I get around that. I know that it is simple and I am missing something easy. Just do not have the knowledge with Outlook forms to find it. I have also embedded a shot of the form.
Thanks for any additional help with this.
Outlook Form
0
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

 
LVL 76

Expert Comment

by:David Lee
ID: 40560112
You must have connected the Project Number field to the Subject field.  Edit the properties of the Project Number field and tie it to a user-defined property instead.  You'll add that property.
0
 

Author Comment

by:blkstrim
ID: 40560117
I just figured out what I missed. You can disregard the last message. However, I do have one other question. When this form is used, and the email arrives, you can no longer see it in the Reading pane in Outlook. You see the following message: This item contains active content that cannot be displayed in the Reading Pane. Open the item to read its contents.
Of course, opening the message allows it to be seen. Is there are way to use the form and still see the message in the reading pane.

Thanks again
0
 
LVL 76

Expert Comment

by:David Lee
ID: 40560163
No.  The reading pane only shows default Outlook form fields.  It will not show custom form fields.  That said, if the form is working properly and prepending the project number to the subject, then why would you also need to see the project number field in the reading pane?
0
 
LVL 37

Expert Comment

by:bbao
ID: 40560964
why not simply populate the Proejct ID at the begining of the Subject field thus every one receiving the email can easily see the Project ID even they don't run Outlook to check the messages.

this will be espcially helpful when the message is received and/or forwarded by external parties such as the clients, contractors and suppliers.
0
 

Author Closing Comment

by:blkstrim
ID: 40571128
thank you to all who helped with this question. This is exactly what I needed.
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

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

The main intent of this article is to make you aware of ‘Exchange fail to mount’ error, its effects, causes, and solution.
Here in this article, you will get a step by step guidance on how to restore an Exchange database to a recovery database. Get a brief on Recovery Database and how it can be used to restore Exchange database in this section!
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
Suggested Courses

650 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