View Single Post
  #8  
Old October 13th 08, 03:14 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default How to Access the "To" Recipient field and update it in outloo

If you read the Help topics on the Remove and Delete methods, you'd see that
neither can be used with an address as a parameter. Instead, you should
iterate the Recipients collection, check the value of each Recipient.Address
property, and when you find a match, call Recipient.Delete.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Venkat M" wrote:


Thank You very much sue...that works perfectly till adding...I was able
to write the loop when user unchecks the box, but i couldn't know which
command to use to clear... Item.Recipients.Remove is giving an error-
after i run the form and deselect the checkbox the error message is
"Type mismatch 'Item.Recipients.Remove'" This is my code, could you
please check it once....
Dim x
Dim n
x=1
n=1
Sub checkbox13_click()
Set MyPage=Item.GetInspector.ModifiedFormPages("Messag e")
If x=1 Then
x=x+1
MyPage.Controls("CheckBox15").Locked = true
MyPage.Controls("CheckBox12").Locked = true
MyPage.Controls("CheckBox14").Locked = true
")
Else
If x= 2*n Then
Set MyPage=Item.GetInspector.ModifiedFormPages("Messag e")
MyPage.Controls("CheckBox15").Locked = false
MyPage.Controls("CheckBox12").Locked = false
MyPage.Controls("CheckBox14").Locked = false
n=n+1
x=x+1
")
Else
Set MyPage=Item.GetInspector.ModifiedFormPages("Messag e")
MyPage.Controls("CheckBox15").Locked = true
MyPage.Controls("CheckBox12").Locked = true
MyPage.Controls("CheckBox14").Locked = true
x=x+1
")
End If
End If
End Sub


I have tried using Delete and Resolve in place of Remove..but same
error...do you have any suggestions in this regard?


Ads