Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating Outlook Distribution List with FoxPro 1

Status
Not open for further replies.

billinmi

Technical User
Mar 10, 2005
3
US
We use a Visual FoxPro application I created for our in-house database, but some of our 'road warriors' need to have some of that information in Outlook. Through MS' site I found some code to have FoxPro create Outlook Contacts and insert the required data into them.


What I can't figure out, however, is how to have FoxPro create email distribution groups - appears to show how to do it in VB, but I'm at a losss as to how to get this to work in VFP.

Any suggestions on how to accomplish this programatically in Visual FoxPro (version 6)?
 

Here is a simplistic view of what is required.
Code:
o= CREATEOBJECT('outlook.application')
ns = o.GetNamespace('mapi')
dl = o.CreateItem(7) && Distribution list
dl.Display


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
I'm sorry, I should have been clearer in my question. It's the actual 'inserting' of email addresses into the Distribution List that I'm having the issue with.
 
To take the example from the MS site.

Code:
o= CREATEOBJECT('outlook.application')
myNameSpace = o.GetNamespace("MAPI")
myDistList = o.CreateItem(7)
myDistList.AddMember(myNameSpace.currentuser)
myDistList.Display


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top