?
Solved

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

Posted on 2004-04-15
6
Medium Priority
?
182 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
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 

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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
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.
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

765 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