Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1742
  • Last Modified:

How to Batch edit outlook mail subject line

How to Batch edit outlook mail subject line
0
JensKristensen
Asked:
JensKristensen
  • 6
  • 5
  • 4
  • +1
1 Solution
 
Chris BottomleyCommented:
Batch edit - I don't believe this to be possible.

What is you want to do, edit all mails in the PST or edit all mails on send/receive?

Chris
0
 
BillDLCommented:
Or do you mean that you just want to send an email via the default email client using a batch command and add a subject line to it?

From what I can see the only useful switches are:

/c ipm.note  =  Create new message
/m recipient@address.com

Example:
outlook.exe /c ipm.note /m recipient@address.com

Outlook 2003 Command Line Switches (expand the "switch Reference" section):

http://office.microsoft.com/en-us/outlook-help/command-line-switches-HP001003110.aspx

I don't think that there is a switch for MS Outlook that allows you to add on a subject line.

You can use the Start menu > Run field, a Windows Shortcut, and perhaps some other methods to execute the "mailto:" protocol and use lots of parameters.

See what happens if you Right-Click on your Desktop and choose New > Shortcut, then paste the following command into the "Location for Item" field:

 
mailto:person1@somewhere.com; person2@elsewhere.com?subject=I need some advice about command line emailing&cc=another@wherever.com&bcc=yet_another@someplace.com&body=First paragraph.%0A%0ASecond paragraph.%0A%0AThird Paragraph.

Open in new window


It may open Outlook with 2 recipients in the "To:" field, one each in the CC and BCC fields, a subject line filled in, and 3 paragraphs in the message body.  Is that useful to you?

More about this here:
http://support.microsoft.com/kb/287573
http://support.microsoft.com/kb/197782
http://www.ianr.unl.edu/internet/mailto.html
0
 
BillDLCommented:
I would suggest that if you are just looking for a good way to send an email from the command line, that you use a standalone program like BLAT.  A lot of systems administrators use this program to email themselves with alerts, or else they create a custom VBScript method to do the same.

What is Blat?
Blat is a Win32 command line utility that sends eMail using SMTP or post to usenet using NNTP.

Blat 2.6.2 (build : Feb 25 2007) with GSS encryption:
http://www.blat.net/

http://sourceforge.net/projects/blat/files/
http://www.blat.net/syntax/syntax.html
http://www.blat.net/examples/
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Brian GeeCommented:
Do you need to have a batch edit of all subject lines of emails in a particular Outlook folder? Would each subject line have the same edited subject line?
0
 
JensKristensenAuthor Commented:
The best solution would be an app that is able to "add" "replace" "delete" etc text strings of all the emails in a particular Outlook folder.
0
 
Chris BottomleyCommented:
If you can identify a list of edit find string and replace string then if macros are ok the answer is yes we can help.

Chris
0
 
Brian GeeCommented:
I have the replace part of this all set, but I guess I'll (or some here will) have to get back to you about the add and delete... could this be done with three different buttons or separate macros?
0
 
Brian GeeCommented:
Actually replace and delete can work interchangeably, but add to a subject line? Would this add be in the beginning of a particular subject line or at the end?
0
 
JensKristensenAuthor Commented:
add would be at the beginning (in 99 pct of cases)
0
 
Brian GeeCommented:
Would a replace procedure only replace certain parts of a subject line or would it replace the entire subject line? Would a delete procedure delete the entire subject line or delete only certain segments?
0
 
JensKristensenAuthor Commented:
replace would be the "normald procedure"  find => replace (preferebly either one-by-one og all-at-a-time.
0
 
Chris BottomleyCommented:
I am happy to try and help but I repeat a list of find and replace and add is necessary in order to try and do so.  Also you say 99% of add is at the beginning but unless/until you indicate how the remaining 1% is processed then we cannot automate the activity.

Note I imagine two list of equal size

Find "A", "B", "D"
Replace "V", "", "X", "Y"

Giving replace A with V
Delete B
Add X
Replace ... etc

The fly in the ointment being how to simplify control of the 1%

Chris
0
 
JensKristensenAuthor Commented:
Disregarding the 1% will be good-enough
0
 
Chris BottomleyCommented:
SO do you want to supply lists or do you want us to create a structure that you will then populate?

Chris
0
 
JensKristensenAuthor Commented:
I just imagine a procedure as in all text processing (f.ex Word ctrl F)
0
 
Chris BottomleyCommented:
The following is a script to add replace or delete so try modifying the two arrays with some data and test on a SAMPLE folder in outlook.  i.e. try copying a folder and then working on the copy.

Chris
Sub addReplaceDelete()
Dim fldr As MAPIFolder
Dim itm As Object
Dim arrFind() As Variant
Dim arrReplace() As Variant
Dim elem As Variant

    arrFind = Array("Fred", "Doris", "", "Peter")
    arrReplace = Array("First", "Second", "Third", "")
    If UBound(arrFind) <> UBound(arrReplace) Then Exit Sub
    For Each itm In Application.Session.PickFolder.items
        If itm.Class = olMail Then
            For elem = LBound(arrFind) To UBound(arrFind)
                If arrFind(elem) = "" Then
                    'Add Datum to beginning
                    Debug.Print "Add " & arrReplace(elem) & " to the beginning"
                    itm.body = arrReplace(elem) & vbCrLf & itm.body
                ElseIf arrReplace(elem) = "" Then
                    ' Delete
                    Debug.Print "Delete " & arrFind(elem) & " throughout"
                    itm.body = replace(itm.body, arrFind(elem), "", 1, , vbTextCompare)
                Else
                    'Replace
                    Debug.Print "Replace " & arrFind(elem) & " with " & arrReplace(elem) & " throughout"
                    itm.body = replace(itm.body, arrFind(elem), arrReplace(elem), 1, , vbTextCompare)
                End If
            Next
        End If
        itm.Save
    Next
End Sub

Open in new window

0
 
JensKristensenAuthor Commented:
Tx. I will report back.
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

  • 6
  • 5
  • 4
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now