PDA

Click to See Complete Forum and Search --> : Adding fax to distribution list


Gensor
Oct 12th, 2005, 02:01 PM
I would like to create a Distribution List of fax numbers using Visual Basic.

I used this to add email address to a DL :


Set otlRecipient = otlApp.Session.CreateRecipient(itmClient.Email1DisplayName)

If otlRecipient.Resolve = True Then
Call m_otlDistList.AddMember(otlRecipient)

Call m_otlDistList.Save
Else
Call MsgBox("Can't find client!", vbOKOnly, "Erreur")
End If


But I don't know how to add fax.

What should my recipient contain to add it as a fax number instead of an email address ?



I do have another question.

Each time I'm running this code, a dialog appears saying this :

A program is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this ?

If this is unexpected, it may be a virus and you should choose "No".

How can I remove this dialog ??

Is there an Outlook setting for this ? Something like "Always allow ..."

RobDog888
Oct 12th, 2005, 04:10 PM
You can not remove or disable the security prompt unless you made a trusted add-in for outlook signed with a digital certificate and then you still may have to set the permissions on it in exchange to give it ful trust.

There is the option of purchasing a thrid party control like "ClickYes" that can bypass the prompt but if its for distribution then this is an unacceptable solution.

Gensor
Oct 12th, 2005, 07:14 PM
The thing I don't understand is that the dialog don't prompt when I add/modify/remove ContactItem but it prompts when I add a ContactItem in a Distribution List.

I think it prompt because I'm using the Recipient Object.. but I don't see why!

RobDog888
Oct 12th, 2005, 07:36 PM
There are certain properties, methods, and funtions that will invoke the prompt. Usually they are the ones like when you try to Send or access an emails receipients/senders properties. It also depends on the version of Outlook you are running. There are only a few restricted items in 2000, more in 2002, and allot in 2003. Its all in an effort to increase protection agains virus' actions etc.

Gensor
Oct 13th, 2005, 08:45 AM
Don't you have any idea for the first part of my first post RobDog ???

You're the VBA king, I'm sure you can help me!!

RobDog888
Oct 16th, 2005, 01:15 PM
If you add a duplicate contact item without the email address but contains the HomeFaxNumber or BusinessFaxNumber that may work.

Gensor
Oct 17th, 2005, 10:36 AM
I mustn't delete the e-mail address! I have to take the same contact without removing anything and add it as a fax recipient

RobDog888
Oct 17th, 2005, 11:07 AM
Right, I wasnt saying to delete the email address, only create a duplicate contact entry with the "- FAX" or something appended to the end of the company name or last name. Then this new duplicate item will have no email, only a fax number.

Gensor
Oct 17th, 2005, 12:14 PM
Actually, I'm able to get the recipients set to the fax number, but when I add it to the distribution list, nothing is add.

To do a test, I entered a contact manually with Business Fax in the DL and I compare the current recipient and the one I want to add and they're the same except for the .Type property. The current one have 0 and the new have 1, I don't know what this mean.

RobDog888
Oct 17th, 2005, 12:20 PM
The Type property is the olMailReceipient type:

olBCC (3)
olCC (2)
olTo (1)
olOriginator (0)

Gensor
Oct 17th, 2005, 12:41 PM
I don't understand something, I'm able to resolve the recipient with Business Fax but when I call the .AddMember method and then call the .Save, nothing happens