Solved

Outlook form to modify subject line

Posted on 2015-01-19
8
640 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
  • 3
  • 3
  • 2
8 Comments
 
LVL 37

Expert Comment

by:Bing CISM / CISSP
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 500 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
 
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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:Bing CISM / CISSP
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Sometimes Outlook might have problems sending a message. There may be various causes- corrupted PST, AV scanner etc. The message, instead of going to the Sent Items folder, sits in the Outbox indefinitely. To remove it you can use a free tool cal…
If you don't know how to downgrade, my instructions below should be helpful.
In this video we show how to create an Accepted Domain 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 Mail Flow >> Ac…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now