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

x
?
Solved

How can I add information to the notes field for a selected group of contacts?

Posted on 2004-04-15
6
Medium Priority
?
185 Views
Last Modified: 2010-04-08

I want to append a sentence to the beginning of the "notes" field of 100 contacts.  These contacts already have various items / bits of information in their notes field.  How can I ad this new bit of information to the entire group of selected contacts without losing the existing information in that field?
0
Comment
Question by:mycomac
[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
6 Comments
 
LVL 13

Accepted Solution

by:
stefri earned 500 total points
ID: 10836718
Familiar with VBA?
Open VBA Editor (Alt F11)
Expand Project in left pane
Double click ThisOutlookSession

In the right window, cut & paste
Option Explicit
Sub appendMyString()
Dim co As Outlook.ContactItem
Dim bodyStr As String
Dim myStringToAppend as String

Dim colSelection As Outlook.Selection
Set colSelection = Application.ActiveExplorer.Selection
myStringToAppend =  "my string to be appended"   '<---Modify to your needs. If you need more than one line use the line below
myStringToAppend =  "my string to be appended" & vbCrLf & "with a new line"

If colSelection.Count = 0 Then
   Set colSelection = Nothing
   Exit Sub
End If
For Each co In colSelection
    bodyStr = co.Body
    co.Body =myStringToAppend &  vbCrLf  &  bodyStr
    co.Save
Next
End Sub

Goto your contacts folders, select the contatcs you want to append
Tools/Macro/Select appendMyString from the list then click Run

Try on one contact to check if it does what you want

Stefri
0
 

Author Comment

by:mycomac
ID: 10845221
This works fine.  Thanks.  

Is there a simple addition that would call a text box when the macro is run so the "Note" could be typed into the text box rather than having to edit the VBA code to change the "Note"?
0
 
LVL 13

Expert Comment

by:stefri
ID: 10845629
Here it goes:
if you click Cancel in the inputbos, nothing will be done
Lets say Notes text is: notesnotesnotes

Input text Example: my string is on one line
New Notes content will be:
my string is one line
notesnotesnotes

If in the string you input contains \n, a new line will be inserted
Input text Example: my string is on\ntwo lines
New Notes content will be:
my string is on
two lines
notesnotesnotes

Enjoy,

Option Explicit
Sub appendMyString()
Dim co As Outlook.ContactItem
Dim bodyStr As String
Dim myStringToAppend As Variant
Dim theRealString As String
Dim colSelection As Outlook.Selection
Set colSelection = Application.ActiveExplorer.Selection
myStringToAppend = InputBox("String to be prepended", "Your string")
    If myStringToAppend <> False Then
            theRealString = Replace(myStringToAppend, "\n", vbCrLf, 1, -1, vbTextCompare)
            If colSelection.Count = 0 Then
               Set colSelection = Nothing
               Exit Sub
            End If
            For Each co In colSelection
                bodyStr = co.Body
                co.Body = theRealString & vbCrLf & bodyStr
                co.Save
            Next
    End If
End Sub
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:mycomac
ID: 10848735
This is perfect.  Thanks
0
 

Author Comment

by:mycomac
ID: 10848790
I'll be happy to offer more points for this one, but first want to ask if it's possible in a similar fashion as above.

Construct a macro that automatically appends the date and subject line of an e-mail message to the beginning of the "Notes" field for all of the contact records that are either in the "To:", "CC", or "BCC" box of the e-mail message (only if the e-mail address is associated with a contact in my Contacts or Global Address list).
0
 
LVL 13

Expert Comment

by:stefri
ID: 10848895
From GAL: you cant modify the properties for a user in the GAL
If OL200x,  did you try to swicch to Activities tab of a contact? Select Email from pulldow menu

Stefri
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this article I discuss my selections of the Top Four free Outlook OST File Viewers available. Open, view and read even damaged OST files by using these tools. They all provide a clear preview of all data such as emails, notes, tasks, calendars, e…
This article describes how to import Lotus Notes Contacts into Outlook 2016, 2013, 2010 and 2007 etc. with a few manual steps. You can easily export and migrate Lotus Notes contacts into Microsoft Outlook without having to use any third party tools.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

649 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