[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to insert text in subject line of existing message

Posted on 2011-02-22
9
Medium Priority
?
635 Views
Last Modified: 2012-05-11
I need to allow users to append text to the subject line of an existing message before sending it by executing a macro item through the menu.  I can handle the menu part, and I can insert the text in the subject line all day long in NEW messages, but what it the user already has the message open and wants to add the text to the existing subject line?  Not a reply or a forward, a message the user just created.  

I found a similar thread here:  http://www.experts-exchange.com/Software/Office_Productivity/Groupware/Outlook/Q_24329884.html  But in my case the users do not want to decide on the text they'll add until AFTER they've created a new message and populated all the fields.  So the macro needs to work on an existing, unsent message, from anywhere within the message, and append the text to the existing subject line.

Anyone have any code for that?  Thanks.  M
0
Comment
Question by:mradicke
[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
  • 5
  • 4
9 Comments
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 34960161
Are you looking for application.activeinspector which would be the current selection for the opened item

application.ActiveInspector.CurrentItem.subject = application.ActiveInspector.CurrentItem.subject & "Fred"

Chris
0
 

Author Comment

by:mradicke
ID: 34966242
Yes, that's what I'm looking for, but I have no idea how to write the rest of the code--the declarations, etc.  I'm a newbie.  Thanks!
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 34967474
The code line does it of course but ...

Can you talk over the process, for example is the text addition fixed or a dynamic and how do you want it triggering.

Chris
0
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 

Author Comment

by:mradicke
ID: 34967517
I plan to to have several options, each triggered by separate macros, and use buttons for each.  The text for each will be fixed.  The use for these is to indicate which signature is to be appended to the message as it passes through the Exchange server.  My users are having difficulty remembering or accurately typing the various options, which are "no_sig", "short_sig", "tax_disclaimer", and "name_only", and this results in the incorrect signature being appended to messages, and misspellings or errors also result in this random text being left in the subject line (the tags are taken off at the same time that the signature is added, at the server level).  Embarrassing to the users, if nothing more.    I was able to provide a means for creating a new message with the text in the subject line, but users became confused and deleted or altered or typed over the text tag.  Or they changed their minds before sending the message and tried to change it with mixed results.   So I think the best solution is to have buttons for each of the choices so they can make the selection, verify they've made the right selection, and then send the message.

To be clear, what I'm trying to do is simply provide a macro that inserts specific text at the end of the subject line of a message that's already been created, and this may actually be a reply, replyall, or forward, if that matters, or it may be a newly created message.   I've just never written much VBS code and I can't seem to make this work.  Thanks!
0
 
LVL 59

Accepted Solution

by:
Chris Bottomley earned 500 total points
ID: 34967581
Okay then your button needs to call a sub and that sub needs to sit in a normal code module:  

To Create a macro:
------------------

Alt + F11 to open the macro editor

  For User Code:
     Insert | Module to insert a code module into the project
     In the project tree select the module.
     Insert the required macro(s) into the selected module, ('Module1' or similar)

The button code will look a bit like:

Chris
Sub button1_Action()
    If Application.Inspectors.count = 0 Then Exit Sub
    If Application.ActiveInspector.CurrentItem.Class <> olMail Then Exit Sub
    Application.ActiveInspector.CurrentItem.Subject = Application.ActiveInspector.CurrentItem.Subject & "Fred"
End Sub


Sub button2_Action()
    If Application.Inspectors.count = 0 Then Exit Sub
    If Application.ActiveInspector.CurrentItem.Class <> olMail Then Exit Sub
    Application.ActiveInspector.CurrentItem.Subject = Application.ActiveInspector.CurrentItem.Subject & "Doris"
End Sub

Open in new window

0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 34967590
Note there is a way to make a context button from which you could select the insertion ... but if you are a newbie that might be a step too far as in 2003 it is more involved to implement.

Chris
0
 

Author Comment

by:mradicke
ID: 34967623
Thanks, Chris, I will try this in the morning--bout done for the nite.  Looks like what I need, though.  

As for a context button, that won't really work for my needs.  These selections will be purely subjective, user by user. And as you say, it might be a bit more than I want to bite off anyway.  This actually looks perfect.  Will let you know if it works.  Thanks again.  M
0
 

Author Comment

by:mradicke
ID: 34975472
This worked, Chris.  Once I had you code it took me less than a half hour to modify it, install it, add the buttons and fully test it.  I'm ready to roll it out.  You're a lifesaver!   Thanks so much!  M
0
 

Author Closing Comment

by:mradicke
ID: 34975482
This assistance was invaluable to me, especially since it was provided quickly and customized to my needs.  Thanks!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Many people use more than one email account and so it becomes difficult for them to manage them when they use separate accounts,  so, in this article, I have shared an easy way to add Other Mail Accounts in your Google Inbox. It helps to combine all…
The core idea of this article is to make you acquainted with the best way in which you can export Exchange mailbox to PST format.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…

656 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