[Last Call] Learn how to a build a cloud-first strategyRegister 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
?
188 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
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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 feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Today as you open your Outlook, you witness an error message: “Outlook is using an old copy of your Outlook Data File…”. Probably, Outlook is accessing an old OST file.
I came across an unsolved Outlook issue and here is my solution.
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…
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

831 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