Creating a Macro

  • Thread starter Thread starter kz
  • Start date Start date
K

kz

I need to create a macro that in Outlook 2000 that
performs the following:

1. Opens new Outlook Message Form
2. Puts in a contact from personal folder into the to
field.

Does anyone know code that would allow me to do this.
 
You could create a mail item (m) from a template:

Set m = Application.CreateItemFromTemplate(t)

Once you get the mail address (a) you can use:

m.Recipients.Add(a)

To get the mail address from your folder. You'll need to do spmething
like:

1) Get the personal folder using something like:

Set mapiNameSpace = Application.GetNamespace("MAPI")
Set inbox = mapiNameSpace.GetDefaultFolder(olFolderInbox)
Set MyFolder = inbox.Folders("Personal Folder2)

2) Cycle through the mails in the folder using a search string for your
contact, then grab the mail item.

3) Get the address using m.Reply.Recipients.Item(1)
 
Back
Top