VBA to update contacts?

  • Thread starter Thread starter RDI
  • Start date Start date
R

RDI

A few years ago we attempted to utilize Outlook's "Netfolders"
configuration. However we had to stop because Outlook was sending out the
updates EVERY day regardless of whether anything had changed. And instead
of just sending the updates, it sent the WHOLE thing. Each email was
averaging around 5 MB and our mail provider refused to send it out. Outlook
got so full of these update messages, it got TOTALLY corrupted.

I'd like to write something SIMILAR in VBA. But what I want to do is to
store a PST file on my network. It won't be used by anyone other than to
serve as a central file. Then Whenever this file is updated the person
managing this file would send an email message to all the employees in our
office. This message would have a set subject line.

My VBA script would be running in the background and recognize this email
message. When it sees this message, the script would delete the message
immediately and delete all the contacts from the specified folder and then
import the new contacts from the file that is on the network.

First of all--is this possible? Second--can someone point me in the right
direction as to how?

TIA
 
I'm not even sure where to start looking for info on how to do it as a "COM"
addin. After posting my original message, I thought that it might work to
utilize a Message Rule. When my message arrives, my script would run.

--

RDI

(remove the exclamation from the email address)

Ken Slovak - said:
You would be best off for distribution purposes writing this as an
Outlook COM addin, but you can do it using VBA code. Your code would
monitor the ItemAdd event on the Inbox for each user. There is some
sample ItemAdd handler code at
http://www.slipstick.com/dev/code/zaphtml.htm#cw.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm


RDI said:
A few years ago we attempted to utilize Outlook's "Netfolders"
configuration. However we had to stop because Outlook was sending out the
updates EVERY day regardless of whether anything had changed. And instead
of just sending the updates, it sent the WHOLE thing. Each email was
averaging around 5 MB and our mail provider refused to send it out. Outlook
got so full of these update messages, it got TOTALLY corrupted.

I'd like to write something SIMILAR in VBA. But what I want to do is to
store a PST file on my network. It won't be used by anyone other than to
serve as a central file. Then Whenever this file is updated the person
managing this file would send an email message to all the employees in our
office. This message would have a set subject line.

My VBA script would be running in the background and recognize this email
message. When it sees this message, the script would delete the message
immediately and delete all the contacts from the specified folder and then
import the new contacts from the file that is on the network.

First of all--is this possible? Second--can someone point me in the right
direction as to how?

TIA

--

RDI

(remove the exclamation from the email address)
 
That's possible but then you get into distributing the rule. For a
primer on COM addins and lots of sample code see Slipstick at
http://www.slipstick.com/dev/comaddins.htm.

Also, see ItemsCB on the Resources page at www.microeye.com for a COM
addin template that shows the best practices and workarounds we've
discovered over the years.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm
 
The following is copy/pasted from the first link you provided me with.

In addition to Outlook, you need one of the following development
environments to create a COM add-in for Office or Outlook:
a.. Visual Basic 5.0 or later (Visual Basic 6.0 is preferred)
b.. Microsoft Office Developer, which includes the ability to compile a
Visual Basic for Applications project into a Dynamic Link Library (DLL)
c.. Any other COM-compliant development environment, such as Microsoft
Visual C++ or Microsoft Visual J++
I don't have VB, MO Developer or any developer environment (other than VBA
within outlook).

So I guess I'll have to go with VBA.

Ken Slovak - said:
That's possible but then you get into distributing the rule. For a
primer on COM addins and lots of sample code see Slipstick at
http://www.slipstick.com/dev/comaddins.htm.

Also, see ItemsCB on the Resources page at www.microeye.com for a COM
addin template that shows the best practices and workarounds we've
discovered over the years.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm
 
Back
Top