custom SMS gateway

  • Thread starter Abdulfatah A. Reslan
  • Start date
A

Abdulfatah A. Reslan

Daer Sir:

in outlook 2007 their feature to send sms to mobile by using specific
sms provider which we can get it during mail account setup via web site
http://messaging.office.microsoft.com/Overview.aspx
my qusetion is if i can put my own gateway to sending SMS instead of
spsecific provider by using VBA for outlook 2007????
 
S

Sue Mosher [MVP-Outlook]

The SMS Link functionality is not exposed in the Outook object model. IIRC, it's a separate add-in. If you want to develop a gateway that uses the SMS Link feature in Outlook 2007, you would need to contact Micrsooft about becoming a provider.

If your wireless provider supports sending messages to (e-mail address removed), that's just another email address to Outlook.
 
A

Abdulfatah A. Reslan

Dear Sue Mosher

thank you very much for your help with your web site.
I started creation new form for sending SMS by select users or distribution
list
from address book I did every think programmatically and get all code and
help from
your web site and VBA for outlook 2007 help but i still have one problem i
can open address book and let customer select contact or distribution list to
send SMS
and then i can read mobile number for recipients for any contact but i cant
retrieve
the contact from distribution list to get his mobile number.

thank you again
 
S

Sue Mosher [MVP-Outlook]

Use the AddressEntry.DisplayType property to determine whether you have a contact or some other type of recipient. If it's a DL, you can try to return the DL by name from the default Contacts folder and then use its GetMember method to return each DL member as a Recipient.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
A

Abdulfatah A. Reslan

Dear Sue Mosher [MVP-Outlook]" thank you again for your help

i try your solution and i can get recipient member for a distrpution
list
and can get the recipents name but when run the GetContact method to
retrive
mobile number i found the error No: (-2147221233 (8004010f))) unable to
find member, buti can get the mobile number from normal recpinit type thats
my code:

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient
Dim DistListRecp As Recipient
Dim DL As DistListItem
Dim i As Integer

Set oDialog = Application.Session.GetSelectNamesDialog

With oDialog
If .Display Then
For Each Recp In .Recipients
If (Recp.DisplayType = olPrivateDistList) Or
(Recp.DisplayType = olDistList) Then
Set DL = _

Outlook.Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items.Item(Recp.Name)
'MsgBox Recp.Name
'Set DL =
Application.Session.GetItemFromID(Recp.Name)

'Set myFolderItems = myFolder.Items
For i = 1 To DL.MemberCount
Set DistListRecp = DL.GetMember(i)
'This code working
MsgBox DistListRecp.name
'but error (-2147221233 (8004010f)))
unable to find member hear

MsgBox
DistListRecp.AddressEntry.GetContact.MobileTelephoneNumber
Next i



Else
this code working
MsgBox
Recp.AddressEntry.GetContact.MobileTelephoneNumber
End If
Next Recp

End If
End With
 
S

Sue Mosher [MVP-Outlook]

That means that the DL member was not created directly from an Outlook contact. That does not mean, however, that there is no contact with that email address, only that there is no directly linked contact. Once you have the email address, you can use the MAPIFolder.Items.Find method to search the user's Contacts folder (or any other contact folder) for a contact with a matching email address.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


Abdulfatah A. Reslan said:
Dear Sue Mosher [MVP-Outlook]" thank you again for your help

i try your solution and i can get recipient member for a distrpution
list
and can get the recipents name but when run the GetContact method to
retrive
mobile number i found the error No: (-2147221233 (8004010f))) unable to
find member, buti can get the mobile number from normal recpinit type thats
my code:

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient
Dim DistListRecp As Recipient
Dim DL As DistListItem
Dim i As Integer

Set oDialog = Application.Session.GetSelectNamesDialog

With oDialog
If .Display Then
For Each Recp In .Recipients
If (Recp.DisplayType = olPrivateDistList) Or
(Recp.DisplayType = olDistList) Then
Set DL = _

Outlook.Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items.Item(Recp.Name)
'MsgBox Recp.Name
'Set DL =
Application.Session.GetItemFromID(Recp.Name)

'Set myFolderItems = myFolder.Items
For i = 1 To DL.MemberCount
Set DistListRecp = DL.GetMember(i)
'This code working
MsgBox DistListRecp.name
'but error (-2147221233 (8004010f)))
unable to find member hear

MsgBox
DistListRecp.AddressEntry.GetContact.MobileTelephoneNumber
Next i



Else
this code working
MsgBox
Recp.AddressEntry.GetContact.MobileTelephoneNumber
End If
Next Recp

End If
End With




Sue Mosher said:
Use the AddressEntry.DisplayType property to determine whether you have a contact or some other type of recipient. If it's a DL, you can try to return the DL by name from the default Contacts folder and then use its GetMember method to return each DL member as a Recipient.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
A

Abdulfatah A. Reslan

Dear Sir :

I never find Outlook.MAPIFolder data type in outlook 2007 please how can
i use it
??



Sue Mosher said:
That means that the DL member was not created directly from an Outlook contact. That does not mean, however, that there is no contact with that email address, only that there is no directly linked contact. Once you have the email address, you can use the MAPIFolder.Items.Find method to search the user's Contacts folder (or any other contact folder) for a contact with a matching email address.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


Abdulfatah A. Reslan said:
Dear Sue Mosher [MVP-Outlook]" thank you again for your help

i try your solution and i can get recipient member for a distrpution
list
and can get the recipents name but when run the GetContact method to
retrive
mobile number i found the error No: (-2147221233 (8004010f))) unable to
find member, buti can get the mobile number from normal recpinit type thats
my code:

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient
Dim DistListRecp As Recipient
Dim DL As DistListItem
Dim i As Integer

Set oDialog = Application.Session.GetSelectNamesDialog

With oDialog
If .Display Then
For Each Recp In .Recipients
If (Recp.DisplayType = olPrivateDistList) Or
(Recp.DisplayType = olDistList) Then
Set DL = _

Outlook.Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items.Item(Recp.Name)
'MsgBox Recp.Name
'Set DL =
Application.Session.GetItemFromID(Recp.Name)

'Set myFolderItems = myFolder.Items
For i = 1 To DL.MemberCount
Set DistListRecp = DL.GetMember(i)
'This code working
MsgBox DistListRecp.name
'but error (-2147221233 (8004010f)))
unable to find member hear

MsgBox
DistListRecp.AddressEntry.GetContact.MobileTelephoneNumber
Next i



Else
this code working
MsgBox
Recp.AddressEntry.GetContact.MobileTelephoneNumber
End If
Next Recp

End If
End With




Sue Mosher said:
Use the AddressEntry.DisplayType property to determine whether you have a contact or some other type of recipient. If it's a DL, you can try to return the DL by name from the default Contacts folder and then use its GetMember method to return each DL member as a Recipient.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54



Dear Sue Mosher

this is my code i can read mobile number for contact but how i can
retrieve contact form distribution list like in last question

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient

Set oDialog = Application.Session.GetSelectNamesDialog



With oDialog

If .Display Then


For Each Recp In .Recipients
MsgBox Recp.AddressEntry.GetContact.MobileTelephoneNumber
Next Recp

End If
End With




:


Dear Sue Mosher

thank you very much for your help with your web site.
I started creation new form for sending SMS by select users or distribution
list
from address book I did every think programmatically and get all code and
help from
your web site and VBA for outlook 2007 help but i still have one problem i
can open address book and let customer select contact or distribution list to
send SMS
and then i can read mobile number for recipients for any contact but i cant
retrieve
the contact from distribution list to get his mobile number.

thank you again



:

The SMS Link functionality is not exposed in the Outook object model. IIRC, it's a separate add-in. If you want to develop a gateway that uses the SMS Link feature in Outlook 2007, you would need to contact Micrsooft about becoming a provider.

If your wireless provider supports sending messages to (e-mail address removed), that's just another email address to Outlook.


Daer Sir:

in outlook 2007 their feature to send sms to mobile by using specific
sms provider which we can get it during mail account setup via web site
http://messaging.office.microsoft.com/Overview.aspx
my qusetion is if i can put my own gateway to sending SMS instead of
spsecific provider by using VBA for outlook 2007????
 
S

Sue Mosher [MVP-Outlook]

Sorry, I forgot you were using OUtlook 2007. In that version, MAPIFolder is a hidden type, for backwards compatibility, and you should instead use Folder.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


Abdulfatah A. Reslan said:
Dear Sir :

I never find Outlook.MAPIFolder data type in outlook 2007 please how can
i use it
??



Sue Mosher said:
That means that the DL member was not created directly from an Outlook contact. That does not mean, however, that there is no contact with that email address, only that there is no directly linked contact. Once you have the email address, you can use the MAPIFolder.Items.Find method to search the user's Contacts folder (or any other contact folder) for a contact with a matching email address.

Abdulfatah A. Reslan said:
Dear Sue Mosher [MVP-Outlook]" thank you again for your help

i try your solution and i can get recipient member for a distrpution
list
and can get the recipents name but when run the GetContact method to
retrive
mobile number i found the error No: (-2147221233 (8004010f))) unable to
find member, buti can get the mobile number from normal recpinit type thats
my code:

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient
Dim DistListRecp As Recipient
Dim DL As DistListItem
Dim i As Integer

Set oDialog = Application.Session.GetSelectNamesDialog

With oDialog
If .Display Then
For Each Recp In .Recipients
If (Recp.DisplayType = olPrivateDistList) Or
(Recp.DisplayType = olDistList) Then
Set DL = _

Outlook.Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items.Item(Recp.Name)
'MsgBox Recp.Name
'Set DL =
Application.Session.GetItemFromID(Recp.Name)

'Set myFolderItems = myFolder.Items
For i = 1 To DL.MemberCount
Set DistListRecp = DL.GetMember(i)
'This code working
MsgBox DistListRecp.name
'but error (-2147221233 (8004010f)))
unable to find member hear

MsgBox
DistListRecp.AddressEntry.GetContact.MobileTelephoneNumber
Next i



Else
this code working
MsgBox
Recp.AddressEntry.GetContact.MobileTelephoneNumber
End If
Next Recp

End If
End With




:

Use the AddressEntry.DisplayType property to determine whether you have a contact or some other type of recipient. If it's a DL, you can try to return the DL by name from the default Contacts folder and then use its GetMember method to return each DL member as a Recipient.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54



Dear Sue Mosher

this is my code i can read mobile number for contact but how i can
retrieve contact form distribution list like in last question

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient

Set oDialog = Application.Session.GetSelectNamesDialog



With oDialog

If .Display Then


For Each Recp In .Recipients
MsgBox Recp.AddressEntry.GetContact.MobileTelephoneNumber
Next Recp

End If
End With




:


Dear Sue Mosher

thank you very much for your help with your web site.
I started creation new form for sending SMS by select users or distribution
list
from address book I did every think programmatically and get all code and
help from
your web site and VBA for outlook 2007 help but i still have one problem i
can open address book and let customer select contact or distribution list to
send SMS
and then i can read mobile number for recipients for any contact but i cant
retrieve
the contact from distribution list to get his mobile number.

thank you again



:

The SMS Link functionality is not exposed in the Outook object model. IIRC, it's a separate add-in. If you want to develop a gateway that uses the SMS Link feature in Outlook 2007, you would need to contact Micrsooft about becoming a provider.

If your wireless provider supports sending messages to (e-mail address removed), that's just another email address to Outlook.


Daer Sir:

in outlook 2007 their feature to send sms to mobile by using specific
sms provider which we can get it during mail account setup via web site
http://messaging.office.microsoft.com/Overview.aspx
my qusetion is if i can put my own gateway to sending SMS instead of
spsecific provider by using VBA for outlook 2007????
 
A

Abdulfatah A. Reslan

thank you very plase may be this is last question:
in this issue i trying to type the
filter for find method to find contact by name which got by command
DL.GetMember(i).name what the proprty schema i have to type it
in the filtter to matching with the member name alot of error i found when
type
"[Name] = '" & DL.GetMember(i).name & "'"
or when type
"[DisplayName] = '" & DL.GetMember(i).name & "'"
and when type
"[FullName] = '" & DL.GetMember(i).name & "'"
did not find any recipent

thank you again im very sorry for my too qusetions number





Sue Mosher said:
Sorry, I forgot you were using OUtlook 2007. In that version, MAPIFolder is a hidden type, for backwards compatibility, and you should instead use Folder.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


Abdulfatah A. Reslan said:
Dear Sir :

I never find Outlook.MAPIFolder data type in outlook 2007 please how can
i use it
??



Sue Mosher said:
That means that the DL member was not created directly from an Outlook contact. That does not mean, however, that there is no contact with that email address, only that there is no directly linked contact. Once you have the email address, you can use the MAPIFolder.Items.Find method to search the user's Contacts folder (or any other contact folder) for a contact with a matching email address.


Dear Sue Mosher [MVP-Outlook]" thank you again for your help

i try your solution and i can get recipient member for a distrpution
list
and can get the recipents name but when run the GetContact method to
retrive
mobile number i found the error No: (-2147221233 (8004010f))) unable to
find member, buti can get the mobile number from normal recpinit type thats
my code:

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient
Dim DistListRecp As Recipient
Dim DL As DistListItem
Dim i As Integer

Set oDialog = Application.Session.GetSelectNamesDialog

With oDialog
If .Display Then
For Each Recp In .Recipients
If (Recp.DisplayType = olPrivateDistList) Or
(Recp.DisplayType = olDistList) Then
Set DL = _

Outlook.Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items.Item(Recp.Name)
'MsgBox Recp.Name
'Set DL =
Application.Session.GetItemFromID(Recp.Name)

'Set myFolderItems = myFolder.Items
For i = 1 To DL.MemberCount
Set DistListRecp = DL.GetMember(i)
'This code working
MsgBox DistListRecp.name
'but error (-2147221233 (8004010f)))
unable to find member hear

MsgBox
DistListRecp.AddressEntry.GetContact.MobileTelephoneNumber
Next i



Else
this code working
MsgBox
Recp.AddressEntry.GetContact.MobileTelephoneNumber
End If
Next Recp

End If
End With




:

Use the AddressEntry.DisplayType property to determine whether you have a contact or some other type of recipient. If it's a DL, you can try to return the DL by name from the default Contacts folder and then use its GetMember method to return each DL member as a Recipient.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54



Dear Sue Mosher

this is my code i can read mobile number for contact but how i can
retrieve contact form distribution list like in last question

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient

Set oDialog = Application.Session.GetSelectNamesDialog



With oDialog

If .Display Then


For Each Recp In .Recipients
MsgBox Recp.AddressEntry.GetContact.MobileTelephoneNumber
Next Recp

End If
End With




:


Dear Sue Mosher

thank you very much for your help with your web site.
I started creation new form for sending SMS by select users or distribution
list
from address book I did every think programmatically and get all code and
help from
your web site and VBA for outlook 2007 help but i still have one problem i
can open address book and let customer select contact or distribution list to
send SMS
and then i can read mobile number for recipients for any contact but i cant
retrieve
the contact from distribution list to get his mobile number.

thank you again



:

The SMS Link functionality is not exposed in the Outook object model. IIRC, it's a separate add-in. If you want to develop a gateway that uses the SMS Link feature in Outlook 2007, you would need to contact Micrsooft about becoming a provider.

If your wireless provider supports sending messages to (e-mail address removed), that's just another email address to Outlook.


Daer Sir:

in outlook 2007 their feature to send sms to mobile by using specific
sms provider which we can get it during mail account setup via web site
http://messaging.office.microsoft.com/Overview.aspx
my qusetion is if i can put my own gateway to sending SMS instead of
spsecific provider by using VBA for outlook 2007????
 
S

Sue Mosher [MVP-Outlook]

Your search string must use an actual ContactItem property name. If you look at the object model, you'll see that there is no Name or DisplayName property for a ContactItem. There is, however, a FullName property. If it were my code, though, I'd be searching on the three Email*Address properties, not on FullName. Names are not unique. Email addresses are.

Remember that there is no guarantee that there will be any matching contact for an entry in a distribution list.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


Abdulfatah A. Reslan said:
thank you very plase may be this is last question:
in this issue i trying to type the
filter for find method to find contact by name which got by command
DL.GetMember(i).name what the proprty schema i have to type it
in the filtter to matching with the member name alot of error i found when
type
"[Name] = '" & DL.GetMember(i).name & "'"
or when type
"[DisplayName] = '" & DL.GetMember(i).name & "'"
and when type
"[FullName] = '" & DL.GetMember(i).name & "'"
did not find any recipent

thank you again im very sorry for my too qusetions number


Sue Mosher said:
Sorry, I forgot you were using OUtlook 2007. In that version, MAPIFolder is a hidden type, for backwards compatibility, and you should instead use Folder.


Abdulfatah A. Reslan said:
Dear Sir :

I never find Outlook.MAPIFolder data type in outlook 2007 please how can
i use it
??



:

That means that the DL member was not created directly from an Outlook contact. That does not mean, however, that there is no contact with that email address, only that there is no directly linked contact. Once you have the email address, you can use the MAPIFolder.Items.Find method to search the user's Contacts folder (or any other contact folder) for a contact with a matching email address.
Dear Sue Mosher [MVP-Outlook]" thank you again for your help

i try your solution and i can get recipient member for a distrpution
list
and can get the recipents name but when run the GetContact method to
retrive
mobile number i found the error No: (-2147221233 (8004010f))) unable to
find member, buti can get the mobile number from normal recpinit type thats
my code:

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient
Dim DistListRecp As Recipient
Dim DL As DistListItem
Dim i As Integer

Set oDialog = Application.Session.GetSelectNamesDialog

With oDialog
If .Display Then
For Each Recp In .Recipients
If (Recp.DisplayType = olPrivateDistList) Or
(Recp.DisplayType = olDistList) Then
Set DL = _

Outlook.Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items.Item(Recp.Name)
'MsgBox Recp.Name
'Set DL =
Application.Session.GetItemFromID(Recp.Name)

'Set myFolderItems = myFolder.Items
For i = 1 To DL.MemberCount
Set DistListRecp = DL.GetMember(i)
'This code working
MsgBox DistListRecp.name
'but error (-2147221233 (8004010f)))
unable to find member hear

MsgBox
DistListRecp.AddressEntry.GetContact.MobileTelephoneNumber
Next i



Else
this code working
MsgBox
Recp.AddressEntry.GetContact.MobileTelephoneNumber
End If
Next Recp

End If
End With




:

Use the AddressEntry.DisplayType property to determine whether you have a contact or some other type of recipient. If it's a DL, you can try to return the DL by name from the default Contacts folder and then use its GetMember method to return each DL member as a Recipient.


Dear Sue Mosher

this is my code i can read mobile number for contact but how i can
retrieve contact form distribution list like in last question

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient

Set oDialog = Application.Session.GetSelectNamesDialog



With oDialog

If .Display Then


For Each Recp In .Recipients
MsgBox Recp.AddressEntry.GetContact.MobileTelephoneNumber
Next Recp

End If
End With




:


Dear Sue Mosher

thank you very much for your help with your web site.
I started creation new form for sending SMS by select users or distribution
list
from address book I did every think programmatically and get all code and
help from
your web site and VBA for outlook 2007 help but i still have one problem i
can open address book and let customer select contact or distribution list to
send SMS
and then i can read mobile number for recipients for any contact but i cant
retrieve
the contact from distribution list to get his mobile number.

thank you again



:

The SMS Link functionality is not exposed in the Outook object model. IIRC, it's a separate add-in. If you want to develop a gateway that uses the SMS Link feature in Outlook 2007, you would need to contact Micrsooft about becoming a provider.

If your wireless provider supports sending messages to (e-mail address removed), that's just another email address to Outlook.


Daer Sir:

in outlook 2007 their feature to send sms to mobile by using specific
sms provider which we can get it during mail account setup via web site
http://messaging.office.microsoft.com/Overview.aspx
my qusetion is if i can put my own gateway to sending SMS instead of
spsecific provider by using VBA for outlook 2007????
 
A

Abdulfatah A. Reslan

i can retrive name only from DL.GetMember(i) any other data in
DL.GetMember(i).AddressEntry.GetContact in cant read it at all
even email Adress


Sue Mosher said:
Your search string must use an actual ContactItem property name. If you look at the object model, you'll see that there is no Name or DisplayName property for a ContactItem. There is, however, a FullName property. If it were my code, though, I'd be searching on the three Email*Address properties, not on FullName. Names are not unique. Email addresses are.

Remember that there is no guarantee that there will be any matching contact for an entry in a distribution list.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


Abdulfatah A. Reslan said:
thank you very plase may be this is last question:
in this issue i trying to type the
filter for find method to find contact by name which got by command
DL.GetMember(i).name what the proprty schema i have to type it
in the filtter to matching with the member name alot of error i found when
type
"[Name] = '" & DL.GetMember(i).name & "'"
or when type
"[DisplayName] = '" & DL.GetMember(i).name & "'"
and when type
"[FullName] = '" & DL.GetMember(i).name & "'"
did not find any recipent

thank you again im very sorry for my too qusetions number


Sue Mosher said:
Sorry, I forgot you were using OUtlook 2007. In that version, MAPIFolder is a hidden type, for backwards compatibility, and you should instead use Folder.



Dear Sir :

I never find Outlook.MAPIFolder data type in outlook 2007 please how can
i use it
??



:

That means that the DL member was not created directly from an Outlook contact. That does not mean, however, that there is no contact with that email address, only that there is no directly linked contact. Once you have the email address, you can use the MAPIFolder.Items.Find method to search the user's Contacts folder (or any other contact folder) for a contact with a matching email address.



Dear Sue Mosher [MVP-Outlook]" thank you again for your help

i try your solution and i can get recipient member for a distrpution
list
and can get the recipents name but when run the GetContact method to
retrive
mobile number i found the error No: (-2147221233 (8004010f))) unable to
find member, buti can get the mobile number from normal recpinit type thats
my code:

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient
Dim DistListRecp As Recipient
Dim DL As DistListItem
Dim i As Integer

Set oDialog = Application.Session.GetSelectNamesDialog

With oDialog
If .Display Then
For Each Recp In .Recipients
If (Recp.DisplayType = olPrivateDistList) Or
(Recp.DisplayType = olDistList) Then
Set DL = _

Outlook.Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items.Item(Recp.Name)
'MsgBox Recp.Name
'Set DL =
Application.Session.GetItemFromID(Recp.Name)

'Set myFolderItems = myFolder.Items
For i = 1 To DL.MemberCount
Set DistListRecp = DL.GetMember(i)
'This code working
MsgBox DistListRecp.name
'but error (-2147221233 (8004010f)))
unable to find member hear

MsgBox
DistListRecp.AddressEntry.GetContact.MobileTelephoneNumber
Next i



Else
this code working
MsgBox
Recp.AddressEntry.GetContact.MobileTelephoneNumber
End If
Next Recp

End If
End With




:

Use the AddressEntry.DisplayType property to determine whether you have a contact or some other type of recipient. If it's a DL, you can try to return the DL by name from the default Contacts folder and then use its GetMember method to return each DL member as a Recipient.


Dear Sue Mosher

this is my code i can read mobile number for contact but how i can
retrieve contact form distribution list like in last question

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient

Set oDialog = Application.Session.GetSelectNamesDialog



With oDialog

If .Display Then


For Each Recp In .Recipients
MsgBox Recp.AddressEntry.GetContact.MobileTelephoneNumber
Next Recp

End If
End With




:


Dear Sue Mosher

thank you very much for your help with your web site.
I started creation new form for sending SMS by select users or distribution
list
from address book I did every think programmatically and get all code and
help from
your web site and VBA for outlook 2007 help but i still have one problem i
can open address book and let customer select contact or distribution list to
send SMS
and then i can read mobile number for recipients for any contact but i cant
retrieve
the contact from distribution list to get his mobile number.

thank you again



:

The SMS Link functionality is not exposed in the Outook object model. IIRC, it's a separate add-in. If you want to develop a gateway that uses the SMS Link feature in Outlook 2007, you would need to contact Micrsooft about becoming a provider.

If your wireless provider supports sending messages to (e-mail address removed), that's just another email address to Outlook.


Daer Sir:

in outlook 2007 their feature to send sms to mobile by using specific
sms provider which we can get it during mail account setup via web site
http://messaging.office.microsoft.com/Overview.aspx
my qusetion is if i can put my own gateway to sending SMS instead of
spsecific provider by using VBA for outlook 2007????
 
S

Sue Mosher [MVP-Outlook]

Look again. GetMember returns a Recipient object, from which you can get the value of the Name or Address property. (Remember, the object browser is your friend.)

GetContact is useful only if AddressEntry.AddressEntryUserType = olOutlookContactAddressEntry.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


Abdulfatah A. Reslan said:
i can retrive name only from DL.GetMember(i) any other data in
DL.GetMember(i).AddressEntry.GetContact in cant read it at all
even email Adress


Sue Mosher said:
Your search string must use an actual ContactItem property name. If you look at the object model, you'll see that there is no Name or DisplayName property for a ContactItem. There is, however, a FullName property. If it were my code, though, I'd be searching on the three Email*Address properties, not on FullName. Names are not unique. Email addresses are.

Remember that there is no guarantee that there will be any matching contact for an entry in a distribution list.

Abdulfatah A. Reslan said:
thank you very plase may be this is last question:
in this issue i trying to type the
filter for find method to find contact by name which got by command
DL.GetMember(i).name what the proprty schema i have to type it
in the filtter to matching with the member name alot of error i found when
type
"[Name] = '" & DL.GetMember(i).name & "'"
or when type
"[DisplayName] = '" & DL.GetMember(i).name & "'"
and when type
"[FullName] = '" & DL.GetMember(i).name & "'"
did not find any recipent

thank you again im very sorry for my too qusetions number


:

Sorry, I forgot you were using OUtlook 2007. In that version, MAPIFolder is a hidden type, for backwards compatibility, and you should instead use Folder.



Dear Sir :

I never find Outlook.MAPIFolder data type in outlook 2007 please how can
i use it
??



:

That means that the DL member was not created directly from an Outlook contact. That does not mean, however, that there is no contact with that email address, only that there is no directly linked contact. Once you have the email address, you can use the MAPIFolder.Items.Find method to search the user's Contacts folder (or any other contact folder) for a contact with a matching email address.



Dear Sue Mosher [MVP-Outlook]" thank you again for your help

i try your solution and i can get recipient member for a distrpution
list
and can get the recipents name but when run the GetContact method to
retrive
mobile number i found the error No: (-2147221233 (8004010f))) unable to
find member, buti can get the mobile number from normal recpinit type thats
my code:

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient
Dim DistListRecp As Recipient
Dim DL As DistListItem
Dim i As Integer

Set oDialog = Application.Session.GetSelectNamesDialog

With oDialog
If .Display Then
For Each Recp In .Recipients
If (Recp.DisplayType = olPrivateDistList) Or
(Recp.DisplayType = olDistList) Then
Set DL = _

Outlook.Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items.Item(Recp.Name)
'MsgBox Recp.Name
'Set DL =
Application.Session.GetItemFromID(Recp.Name)

'Set myFolderItems = myFolder.Items
For i = 1 To DL.MemberCount
Set DistListRecp = DL.GetMember(i)
'This code working
MsgBox DistListRecp.name
'but error (-2147221233 (8004010f)))
unable to find member hear

MsgBox
DistListRecp.AddressEntry.GetContact.MobileTelephoneNumber
Next i



Else
this code working
MsgBox
Recp.AddressEntry.GetContact.MobileTelephoneNumber
End If
Next Recp

End If
End With




:

Use the AddressEntry.DisplayType property to determine whether you have a contact or some other type of recipient. If it's a DL, you can try to return the DL by name from the default Contacts folder and then use its GetMember method to return each DL member as a Recipient.
Dear Sue Mosher

this is my code i can read mobile number for contact but how i can
retrieve contact form distribution list like in last question

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient

Set oDialog = Application.Session.GetSelectNamesDialog



With oDialog

If .Display Then


For Each Recp In .Recipients
MsgBox Recp.AddressEntry.GetContact.MobileTelephoneNumber
Next Recp

End If
End With




:


Dear Sue Mosher

thank you very much for your help with your web site.
I started creation new form for sending SMS by select users or distribution
list
from address book I did every think programmatically and get all code and
help from
your web site and VBA for outlook 2007 help but i still have one problem i
can open address book and let customer select contact or distribution list to
send SMS
and then i can read mobile number for recipients for any contact but i cant
retrieve
the contact from distribution list to get his mobile number.

thank you again



:

The SMS Link functionality is not exposed in the Outook object model. IIRC, it's a separate add-in. If you want to develop a gateway that uses the SMS Link feature in Outlook 2007, you would need to contact Micrsooft about becoming a provider.

If your wireless provider supports sending messages to (e-mail address removed), that's just another email address to Outlook.


Daer Sir:

in outlook 2007 their feature to send sms to mobile by using specific
sms provider which we can get it during mail account setup via web site
http://messaging.office.microsoft.com/Overview.aspx
my qusetion is if i can put my own gateway to sending SMS instead of
spsecific provider by using VBA for outlook 2007????
 
A

Abdulfatah A. Reslan

Dear Sue Mosher:
you are right GetMember returns a Recipient object, from which you can
get the value of the Name or Address property.

but Recipient object also has the following property:
Recipient.AddressEntry.GetContact.MobileTelephonenumber

if i get the recipient object via getmember i cant read above property,
although i can read the Recipient.name and Recipient.address only,
but i can
read it fine if the recipient object got from GetSelectNamesDialog.Recipients


please help me i face a big problem with thes issue

Sue Mosher said:
Look again. GetMember returns a Recipient object, from which you can get the value of the Name or Address property. (Remember, the object browser is your friend.)

GetContact is useful only if AddressEntry.AddressEntryUserType = olOutlookContactAddressEntry.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


Abdulfatah A. Reslan said:
i can retrive name only from DL.GetMember(i) any other data in
DL.GetMember(i).AddressEntry.GetContact in cant read it at all
even email Adress


Sue Mosher said:
Your search string must use an actual ContactItem property name. If you look at the object model, you'll see that there is no Name or DisplayName property for a ContactItem. There is, however, a FullName property. If it were my code, though, I'd be searching on the three Email*Address properties, not on FullName. Names are not unique. Email addresses are.

Remember that there is no guarantee that there will be any matching contact for an entry in a distribution list.



thank you very plase may be this is last question:
in this issue i trying to type the
filter for find method to find contact by name which got by command
DL.GetMember(i).name what the proprty schema i have to type it
in the filtter to matching with the member name alot of error i found when
type
"[Name] = '" & DL.GetMember(i).name & "'"
or when type
"[DisplayName] = '" & DL.GetMember(i).name & "'"
and when type
"[FullName] = '" & DL.GetMember(i).name & "'"
did not find any recipent

thank you again im very sorry for my too qusetions number


:

Sorry, I forgot you were using OUtlook 2007. In that version, MAPIFolder is a hidden type, for backwards compatibility, and you should instead use Folder.



Dear Sir :

I never find Outlook.MAPIFolder data type in outlook 2007 please how can
i use it
??



:

That means that the DL member was not created directly from an Outlook contact. That does not mean, however, that there is no contact with that email address, only that there is no directly linked contact. Once you have the email address, you can use the MAPIFolder.Items.Find method to search the user's Contacts folder (or any other contact folder) for a contact with a matching email address.



Dear Sue Mosher [MVP-Outlook]" thank you again for your help

i try your solution and i can get recipient member for a distrpution
list
and can get the recipents name but when run the GetContact method to
retrive
mobile number i found the error No: (-2147221233 (8004010f))) unable to
find member, buti can get the mobile number from normal recpinit type thats
my code:

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient
Dim DistListRecp As Recipient
Dim DL As DistListItem
Dim i As Integer

Set oDialog = Application.Session.GetSelectNamesDialog

With oDialog
If .Display Then
For Each Recp In .Recipients
If (Recp.DisplayType = olPrivateDistList) Or
(Recp.DisplayType = olDistList) Then
Set DL = _

Outlook.Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items.Item(Recp.Name)
'MsgBox Recp.Name
'Set DL =
Application.Session.GetItemFromID(Recp.Name)

'Set myFolderItems = myFolder.Items
For i = 1 To DL.MemberCount
Set DistListRecp = DL.GetMember(i)
'This code working
MsgBox DistListRecp.name
'but error (-2147221233 (8004010f)))
unable to find member hear

MsgBox
DistListRecp.AddressEntry.GetContact.MobileTelephoneNumber
Next i



Else
this code working
MsgBox
Recp.AddressEntry.GetContact.MobileTelephoneNumber
End If
Next Recp

End If
End With




:

Use the AddressEntry.DisplayType property to determine whether you have a contact or some other type of recipient. If it's a DL, you can try to return the DL by name from the default Contacts folder and then use its GetMember method to return each DL member as a Recipient.



Dear Sue Mosher

this is my code i can read mobile number for contact but how i can
retrieve contact form distribution list like in last question

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient

Set oDialog = Application.Session.GetSelectNamesDialog



With oDialog

If .Display Then


For Each Recp In .Recipients
MsgBox Recp.AddressEntry.GetContact.MobileTelephoneNumber
Next Recp

End If
End With




:


Dear Sue Mosher

thank you very much for your help with your web site.
I started creation new form for sending SMS by select users or distribution
list
from address book I did every think programmatically and get all code and
help from
your web site and VBA for outlook 2007 help but i still have one problem i
can open address book and let customer select contact or distribution list to
send SMS
and then i can read mobile number for recipients for any contact but i cant
retrieve
the contact from distribution list to get his mobile number.

thank you again



:

The SMS Link functionality is not exposed in the Outook object model. IIRC, it's a separate add-in. If you want to develop a gateway that uses the SMS Link feature in Outlook 2007, you would need to contact Micrsooft about becoming a provider.

If your wireless provider supports sending messages to (e-mail address removed), that's just another email address to Outlook.


Daer Sir:

in outlook 2007 their feature to send sms to mobile by using specific
sms provider which we can get it during mail account setup via web site
http://messaging.office.microsoft.com/Overview.aspx
my qusetion is if i can put my own gateway to sending SMS instead of
spsecific provider by using VBA for outlook 2007????
 
S

Sue Mosher [MVP-Outlook]

As I tried to explain earlier, AddressEntry.GetContact will return a ContactItem only if the DL member was created from a contact. If it was not, you can use the Folder.Items.Find to search for a contact that matches the recipient address.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


Abdulfatah A. Reslan said:
Dear Sue Mosher:
you are right GetMember returns a Recipient object, from which you can
get the value of the Name or Address property.

but Recipient object also has the following property:
Recipient.AddressEntry.GetContact.MobileTelephonenumber

if i get the recipient object via getmember i cant read above property,
although i can read the Recipient.name and Recipient.address only,
but i can
read it fine if the recipient object got from GetSelectNamesDialog.Recipients


please help me i face a big problem with thes issue

Sue Mosher said:
Look again. GetMember returns a Recipient object, from which you can get the value of the Name or Address property. (Remember, the object browser is your friend.)

GetContact is useful only if AddressEntry.AddressEntryUserType = olOutlookContactAddressEntry.

Abdulfatah A. Reslan said:
i can retrive name only from DL.GetMember(i) any other data in
DL.GetMember(i).AddressEntry.GetContact in cant read it at all
even email Adress


:

Your search string must use an actual ContactItem property name. If you look at the object model, you'll see that there is no Name or DisplayName property for a ContactItem. There is, however, a FullName property. If it were my code, though, I'd be searching on the three Email*Address properties, not on FullName. Names are not unique. Email addresses are.

Remember that there is no guarantee that there will be any matching contact for an entry in a distribution list.



thank you very plase may be this is last question:
in this issue i trying to type the
filter for find method to find contact by name which got by command
DL.GetMember(i).name what the proprty schema i have to type it
in the filtter to matching with the member name alot of error i found when
type
"[Name] = '" & DL.GetMember(i).name & "'"
or when type
"[DisplayName] = '" & DL.GetMember(i).name & "'"
and when type
"[FullName] = '" & DL.GetMember(i).name & "'"
did not find any recipent

thank you again im very sorry for my too qusetions number


:

Sorry, I forgot you were using OUtlook 2007. In that version, MAPIFolder is a hidden type, for backwards compatibility, and you should instead use Folder.



Dear Sir :

I never find Outlook.MAPIFolder data type in outlook 2007 please how can
i use it
??



:

That means that the DL member was not created directly from an Outlook contact. That does not mean, however, that there is no contact with that email address, only that there is no directly linked contact. Once you have the email address, you can use the MAPIFolder.Items.Find method to search the user's Contacts folder (or any other contact folder) for a contact with a matching email address.



Dear Sue Mosher [MVP-Outlook]" thank you again for your help

i try your solution and i can get recipient member for a distrpution
list
and can get the recipents name but when run the GetContact method to
retrive
mobile number i found the error No: (-2147221233 (8004010f))) unable to
find member, buti can get the mobile number from normal recpinit type thats
my code:

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient
Dim DistListRecp As Recipient
Dim DL As DistListItem
Dim i As Integer

Set oDialog = Application.Session.GetSelectNamesDialog

With oDialog
If .Display Then
For Each Recp In .Recipients
If (Recp.DisplayType = olPrivateDistList) Or
(Recp.DisplayType = olDistList) Then
Set DL = _

Outlook.Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items.Item(Recp.Name)
'MsgBox Recp.Name
'Set DL =
Application.Session.GetItemFromID(Recp.Name)

'Set myFolderItems = myFolder.Items
For i = 1 To DL.MemberCount
Set DistListRecp = DL.GetMember(i)
'This code working
MsgBox DistListRecp.name
'but error (-2147221233 (8004010f)))
unable to find member hear

MsgBox
DistListRecp.AddressEntry.GetContact.MobileTelephoneNumber
Next i



Else
this code working
MsgBox
Recp.AddressEntry.GetContact.MobileTelephoneNumber
End If
Next Recp

End If
End With




:

Use the AddressEntry.DisplayType property to determine whether you have a contact or some other type of recipient. If it's a DL, you can try to return the DL by name from the default Contacts folder and then use its GetMember method to return each DL member as a Recipient.



Dear Sue Mosher

this is my code i can read mobile number for contact but how i can
retrieve contact form distribution list like in last question

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient

Set oDialog = Application.Session.GetSelectNamesDialog



With oDialog

If .Display Then


For Each Recp In .Recipients
MsgBox Recp.AddressEntry.GetContact.MobileTelephoneNumber
Next Recp

End If
End With




:


Dear Sue Mosher

thank you very much for your help with your web site.
I started creation new form for sending SMS by select users or distribution
list
from address book I did every think programmatically and get all code and
help from
your web site and VBA for outlook 2007 help but i still have one problem i
can open address book and let customer select contact or distribution list to
send SMS
and then i can read mobile number for recipients for any contact but i cant
retrieve
the contact from distribution list to get his mobile number.

thank you again



:

The SMS Link functionality is not exposed in the Outook object model. IIRC, it's a separate add-in. If you want to develop a gateway that uses the SMS Link feature in Outlook 2007, you would need to contact Micrsooft about becoming a provider.

If your wireless provider supports sending messages to (e-mail address removed), that's just another email address to Outlook.


Daer Sir:

in outlook 2007 their feature to send sms to mobile by using specific
sms provider which we can get it during mail account setup via web site
http://messaging.office.microsoft.com/Overview.aspx
my qusetion is if i can put my own gateway to sending SMS instead of
spsecific provider by using VBA for outlook 2007????
 
A

Abdulfatah A. Reslan

Dear Sue Mosher

i create all recpient and distrlist thrugh outlook however i try the find
method in folders object it working but its rterun object but such object
contain the name only
also.

the code is
Set obj =
Outlook.Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items.Find("[Email1Address] = '" & DL.GetMemer(i).Address & "'")

obj return address only also i dont want to save email addresses for
recepint i just enter mobile only

thaak you again

Sue Mosher said:
As I tried to explain earlier, AddressEntry.GetContact will return a ContactItem only if the DL member was created from a contact. If it was not, you can use the Folder.Items.Find to search for a contact that matches the recipient address.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


Abdulfatah A. Reslan said:
Dear Sue Mosher:
you are right GetMember returns a Recipient object, from which you can
get the value of the Name or Address property.

but Recipient object also has the following property:
Recipient.AddressEntry.GetContact.MobileTelephonenumber

if i get the recipient object via getmember i cant read above property,
although i can read the Recipient.name and Recipient.address only,
but i can
read it fine if the recipient object got from GetSelectNamesDialog.Recipients


please help me i face a big problem with thes issue

Sue Mosher said:
Look again. GetMember returns a Recipient object, from which you can get the value of the Name or Address property. (Remember, the object browser is your friend.)

GetContact is useful only if AddressEntry.AddressEntryUserType = olOutlookContactAddressEntry.


i can retrive name only from DL.GetMember(i) any other data in
DL.GetMember(i).AddressEntry.GetContact in cant read it at all
even email Adress


:

Your search string must use an actual ContactItem property name. If you look at the object model, you'll see that there is no Name or DisplayName property for a ContactItem. There is, however, a FullName property. If it were my code, though, I'd be searching on the three Email*Address properties, not on FullName. Names are not unique. Email addresses are.

Remember that there is no guarantee that there will be any matching contact for an entry in a distribution list.



thank you very plase may be this is last question:
in this issue i trying to type the
filter for find method to find contact by name which got by command
DL.GetMember(i).name what the proprty schema i have to type it
in the filtter to matching with the member name alot of error i found when
type
"[Name] = '" & DL.GetMember(i).name & "'"
or when type
"[DisplayName] = '" & DL.GetMember(i).name & "'"
and when type
"[FullName] = '" & DL.GetMember(i).name & "'"
did not find any recipent

thank you again im very sorry for my too qusetions number


:

Sorry, I forgot you were using OUtlook 2007. In that version, MAPIFolder is a hidden type, for backwards compatibility, and you should instead use Folder.



Dear Sir :

I never find Outlook.MAPIFolder data type in outlook 2007 please how can
i use it
??



:

That means that the DL member was not created directly from an Outlook contact. That does not mean, however, that there is no contact with that email address, only that there is no directly linked contact. Once you have the email address, you can use the MAPIFolder.Items.Find method to search the user's Contacts folder (or any other contact folder) for a contact with a matching email address.



Dear Sue Mosher [MVP-Outlook]" thank you again for your help

i try your solution and i can get recipient member for a distrpution
list
and can get the recipents name but when run the GetContact method to
retrive
mobile number i found the error No: (-2147221233 (8004010f))) unable to
find member, buti can get the mobile number from normal recpinit type thats
my code:

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient
Dim DistListRecp As Recipient
Dim DL As DistListItem
Dim i As Integer

Set oDialog = Application.Session.GetSelectNamesDialog

With oDialog
If .Display Then
For Each Recp In .Recipients
If (Recp.DisplayType = olPrivateDistList) Or
(Recp.DisplayType = olDistList) Then
Set DL = _

Outlook.Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items.Item(Recp.Name)
'MsgBox Recp.Name
'Set DL =
Application.Session.GetItemFromID(Recp.Name)

'Set myFolderItems = myFolder.Items
For i = 1 To DL.MemberCount
Set DistListRecp = DL.GetMember(i)
'This code working
MsgBox DistListRecp.name
'but error (-2147221233 (8004010f)))
unable to find member hear

MsgBox
DistListRecp.AddressEntry.GetContact.MobileTelephoneNumber
Next i



Else
this code working
MsgBox
Recp.AddressEntry.GetContact.MobileTelephoneNumber
End If
Next Recp

End If
End With




:

Use the AddressEntry.DisplayType property to determine whether you have a contact or some other type of recipient. If it's a DL, you can try to return the DL by name from the default Contacts folder and then use its GetMember method to return each DL member as a Recipient.



Dear Sue Mosher

this is my code i can read mobile number for contact but how i can
retrieve contact form distribution list like in last question

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient

Set oDialog = Application.Session.GetSelectNamesDialog



With oDialog

If .Display Then


For Each Recp In .Recipients
MsgBox Recp.AddressEntry.GetContact.MobileTelephoneNumber
Next Recp

End If
End With




:


Dear Sue Mosher

thank you very much for your help with your web site.
I started creation new form for sending SMS by select users or distribution
list
from address book I did every think programmatically and get all code and
help from
your web site and VBA for outlook 2007 help but i still have one problem i
can open address book and let customer select contact or distribution list to
send SMS
and then i can read mobile number for recipients for any contact but i cant
retrieve
the contact from distribution list to get his mobile number.

thank you again



:

The SMS Link functionality is not exposed in the Outook object model. IIRC, it's a separate add-in. If you want to develop a gateway that uses the SMS Link feature in Outlook 2007, you would need to contact Micrsooft about becoming a provider.

If your wireless provider supports sending messages to (e-mail address removed), that's just another email address to Outlook.


Daer Sir:

in outlook 2007 their feature to send sms to mobile by using specific
sms provider which we can get it during mail account setup via web site
http://messaging.office.microsoft.com/Overview.aspx
my qusetion is if i can put my own gateway to sending SMS instead of
spsecific provider by using VBA for outlook 2007????
 
A

Abdulfatah A. Reslan

Dear Sue Mosher


Soory the lasr replay was error read reply again hear



i create all recipient and distrlist through outlook however i try the
find
method in folders object it working but its return object but such object
contain the name only
also.

the code is
Set obj =
Outlook.Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items.Find("[Email1Address] = '" & DL.GetMemer(i).Address & "'")

obj return name only also i don't want to save email addresses for
recipient i just enter mobile only

thank you again


Abdulfatah A. Reslan said:
Dear Sue Mosher

i create all recpient and distrlist thrugh outlook however i try the find
method in folders object it working but its rterun object but such object
contain the name only
also.

the code is
Set obj =
Outlook.Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items.Find("[Email1Address] = '" & DL.GetMemer(i).Address & "'")

obj return address only also i dont want to save email addresses for
recepint i just enter mobile only

thaak you again

Sue Mosher said:
As I tried to explain earlier, AddressEntry.GetContact will return a ContactItem only if the DL member was created from a contact. If it was not, you can use the Folder.Items.Find to search for a contact that matches the recipient address.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


Abdulfatah A. Reslan said:
Dear Sue Mosher:
you are right GetMember returns a Recipient object, from which you can
get the value of the Name or Address property.

but Recipient object also has the following property:
Recipient.AddressEntry.GetContact.MobileTelephonenumber

if i get the recipient object via getmember i cant read above property,
although i can read the Recipient.name and Recipient.address only,
but i can
read it fine if the recipient object got from GetSelectNamesDialog.Recipients


please help me i face a big problem with thes issue

:

Look again. GetMember returns a Recipient object, from which you can get the value of the Name or Address property. (Remember, the object browser is your friend.)

GetContact is useful only if AddressEntry.AddressEntryUserType = olOutlookContactAddressEntry.
i can retrive name only from DL.GetMember(i) any other data in
DL.GetMember(i).AddressEntry.GetContact in cant read it at all
even email Adress


:

Your search string must use an actual ContactItem property name. If you look at the object model, you'll see that there is no Name or DisplayName property for a ContactItem. There is, however, a FullName property. If it were my code, though, I'd be searching on the three Email*Address properties, not on FullName. Names are not unique. Email addresses are.

Remember that there is no guarantee that there will be any matching contact for an entry in a distribution list.



thank you very plase may be this is last question:
in this issue i trying to type the
filter for find method to find contact by name which got by command
DL.GetMember(i).name what the proprty schema i have to type it
in the filtter to matching with the member name alot of error i found when
type
"[Name] = '" & DL.GetMember(i).name & "'"
or when type
"[DisplayName] = '" & DL.GetMember(i).name & "'"
and when type
"[FullName] = '" & DL.GetMember(i).name & "'"
did not find any recipent

thank you again im very sorry for my too qusetions number


:

Sorry, I forgot you were using OUtlook 2007. In that version, MAPIFolder is a hidden type, for backwards compatibility, and you should instead use Folder.



Dear Sir :

I never find Outlook.MAPIFolder data type in outlook 2007 please how can
i use it
??



:

That means that the DL member was not created directly from an Outlook contact. That does not mean, however, that there is no contact with that email address, only that there is no directly linked contact. Once you have the email address, you can use the MAPIFolder.Items.Find method to search the user's Contacts folder (or any other contact folder) for a contact with a matching email address.



Dear Sue Mosher [MVP-Outlook]" thank you again for your help

i try your solution and i can get recipient member for a distrpution
list
and can get the recipents name but when run the GetContact method to
retrive
mobile number i found the error No: (-2147221233 (8004010f))) unable to
find member, buti can get the mobile number from normal recpinit type thats
my code:

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient
Dim DistListRecp As Recipient
Dim DL As DistListItem
Dim i As Integer

Set oDialog = Application.Session.GetSelectNamesDialog

With oDialog
If .Display Then
For Each Recp In .Recipients
If (Recp.DisplayType = olPrivateDistList) Or
(Recp.DisplayType = olDistList) Then
Set DL = _

Outlook.Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items.Item(Recp.Name)
'MsgBox Recp.Name
'Set DL =
Application.Session.GetItemFromID(Recp.Name)

'Set myFolderItems = myFolder.Items
For i = 1 To DL.MemberCount
Set DistListRecp = DL.GetMember(i)
'This code working
MsgBox DistListRecp.name
'but error (-2147221233 (8004010f)))
unable to find member hear

MsgBox
DistListRecp.AddressEntry.GetContact.MobileTelephoneNumber
Next i



Else
this code working
MsgBox
Recp.AddressEntry.GetContact.MobileTelephoneNumber
End If
Next Recp

End If
End With




:

Use the AddressEntry.DisplayType property to determine whether you have a contact or some other type of recipient. If it's a DL, you can try to return the DL by name from the default Contacts folder and then use its GetMember method to return each DL member as a Recipient.



Dear Sue Mosher

this is my code i can read mobile number for contact but how i can
retrieve contact form distribution list like in last question

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient

Set oDialog = Application.Session.GetSelectNamesDialog



With oDialog

If .Display Then


For Each Recp In .Recipients
MsgBox Recp.AddressEntry.GetContact.MobileTelephoneNumber
Next Recp

End If
End With




:


Dear Sue Mosher

thank you very much for your help with your web site.
I started creation new form for sending SMS by select users or distribution
list
from address book I did every think programmatically and get all code and
help from
your web site and VBA for outlook 2007 help but i still have one problem i
can open address book and let customer select contact or distribution list to
send SMS
and then i can read mobile number for recipients for any contact but i cant
retrieve
the contact from distribution list to get his mobile number.

thank you again



:

The SMS Link functionality is not exposed in the Outook object model. IIRC, it's a separate add-in. If you want to develop a gateway that uses the SMS Link feature in Outlook 2007, you would need to contact Micrsooft about becoming a provider.

If your wireless provider supports sending messages to (e-mail address removed), that's just another email address to Outlook.


Daer Sir:

in outlook 2007 their feature to send sms to mobile by using specific
sms provider which we can get it during mail account setup via web site
http://messaging.office.microsoft.com/Overview.aspx
my qusetion is if i can put my own gateway to sending SMS instead of
spsecific provider by using VBA for outlook 2007????
 
S

Sue Mosher [MVP-Outlook]

Your code snippet doesn't go far enough. It shows no attempt to get the mobile number. If obj returns a valid ContactItem, then you can get the value of the mobile number with obj.MobileTelephoneNumber.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


Abdulfatah A. Reslan said:
i create all recipient and distrlist through outlook however i try the
find
method in folders object it working but its return object but such object
contain the name only
also.

the code is
Set obj =
Outlook.Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items.Find("[Email1Address] = '" & DL.GetMemer(i).Address & "'")

obj return name only also i don't want to save email addresses for
recipient i just enter mobile only

thank you again


Abdulfatah A. Reslan said:
Dear Sue Mosher

i create all recpient and distrlist thrugh outlook however i try the find
method in folders object it working but its rterun object but such object
contain the name only
also.

the code is
Set obj =
Outlook.Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items.Find("[Email1Address] = '" & DL.GetMemer(i).Address & "'")

obj return address only also i dont want to save email addresses for
recepint i just enter mobile only

thaak you again

Sue Mosher said:
As I tried to explain earlier, AddressEntry.GetContact will return a ContactItem only if the DL member was created from a contact. If it was not, you can use the Folder.Items.Find to search for a contact that matches the recipient address.


Dear Sue Mosher:
you are right GetMember returns a Recipient object, from which you can
get the value of the Name or Address property.

but Recipient object also has the following property:
Recipient.AddressEntry.GetContact.MobileTelephonenumber

if i get the recipient object via getmember i cant read above property,
although i can read the Recipient.name and Recipient.address only,
but i can
read it fine if the recipient object got from GetSelectNamesDialog.Recipients


please help me i face a big problem with thes issue

:

Look again. GetMember returns a Recipient object, from which you can get the value of the Name or Address property. (Remember, the object browser is your friend.)

GetContact is useful only if AddressEntry.AddressEntryUserType = olOutlookContactAddressEntry.



i can retrive name only from DL.GetMember(i) any other data in
DL.GetMember(i).AddressEntry.GetContact in cant read it at all
even email Adress


:

Your search string must use an actual ContactItem property name. If you look at the object model, you'll see that there is no Name or DisplayName property for a ContactItem. There is, however, a FullName property. If it were my code, though, I'd be searching on the three Email*Address properties, not on FullName. Names are not unique. Email addresses are.

Remember that there is no guarantee that there will be any matching contact for an entry in a distribution list.



thank you very plase may be this is last question:
in this issue i trying to type the
filter for find method to find contact by name which got by command
DL.GetMember(i).name what the proprty schema i have to type it
in the filtter to matching with the member name alot of error i found when
type
"[Name] = '" & DL.GetMember(i).name & "'"
or when type
"[DisplayName] = '" & DL.GetMember(i).name & "'"
and when type
"[FullName] = '" & DL.GetMember(i).name & "'"
did not find any recipent

thank you again im very sorry for my too qusetions number


:

Sorry, I forgot you were using OUtlook 2007. In that version, MAPIFolder is a hidden type, for backwards compatibility, and you should instead use Folder.



Dear Sir :

I never find Outlook.MAPIFolder data type in outlook 2007 please how can
i use it
??



:

That means that the DL member was not created directly from an Outlook contact. That does not mean, however, that there is no contact with that email address, only that there is no directly linked contact. Once you have the email address, you can use the MAPIFolder.Items.Find method to search the user's Contacts folder (or any other contact folder) for a contact with a matching email address.



Dear Sue Mosher [MVP-Outlook]" thank you again for your help

i try your solution and i can get recipient member for a distrpution
list
and can get the recipents name but when run the GetContact method to
retrive
mobile number i found the error No: (-2147221233 (8004010f))) unable to
find member, buti can get the mobile number from normal recpinit type thats
my code:

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient
Dim DistListRecp As Recipient
Dim DL As DistListItem
Dim i As Integer

Set oDialog = Application.Session.GetSelectNamesDialog

With oDialog
If .Display Then
For Each Recp In .Recipients
If (Recp.DisplayType = olPrivateDistList) Or
(Recp.DisplayType = olDistList) Then
Set DL = _

Outlook.Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items.Item(Recp.Name)
'MsgBox Recp.Name
'Set DL =
Application.Session.GetItemFromID(Recp.Name)

'Set myFolderItems = myFolder.Items
For i = 1 To DL.MemberCount
Set DistListRecp = DL.GetMember(i)
'This code working
MsgBox DistListRecp.name
'but error (-2147221233 (8004010f)))
unable to find member hear

MsgBox
DistListRecp.AddressEntry.GetContact.MobileTelephoneNumber
Next i



Else
this code working
MsgBox
Recp.AddressEntry.GetContact.MobileTelephoneNumber
End If
Next Recp

End If
End With




:

Use the AddressEntry.DisplayType property to determine whether you have a contact or some other type of recipient. If it's a DL, you can try to return the DL by name from the default Contacts folder and then use its GetMember method to return each DL member as a Recipient.



Dear Sue Mosher

this is my code i can read mobile number for contact but how i can
retrieve contact form distribution list like in last question

Dim oDialog As SelectNamesDialog
Dim Recp As Recipient

Set oDialog = Application.Session.GetSelectNamesDialog



With oDialog

If .Display Then


For Each Recp In .Recipients
MsgBox Recp.AddressEntry.GetContact.MobileTelephoneNumber
Next Recp

End If
End With




:


Dear Sue Mosher

thank you very much for your help with your web site.
I started creation new form for sending SMS by select users or distribution
list
from address book I did every think programmatically and get all code and
help from
your web site and VBA for outlook 2007 help but i still have one problem i
can open address book and let customer select contact or distribution list to
send SMS
and then i can read mobile number for recipients for any contact but i cant
retrieve
the contact from distribution list to get his mobile number.

thank you again



:

The SMS Link functionality is not exposed in the Outook object model. IIRC, it's a separate add-in. If you want to develop a gateway that uses the SMS Link feature in Outlook 2007, you would need to contact Micrsooft about becoming a provider.

If your wireless provider supports sending messages to (e-mail address removed), that's just another email address to Outlook.


Daer Sir:

in outlook 2007 their feature to send sms to mobile by using specific
sms provider which we can get it during mail account setup via web site
http://messaging.office.microsoft.com/Overview.aspx
my qusetion is if i can put my own gateway to sending SMS instead of
spsecific provider by using VBA for outlook 2007????
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top