Property in Class

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I am creating a custom email class and I have a property as follows:

Private _BccCollection As Mail.MailAddressCollection
Public WriteOnly Property BccCollection() As
Mail.MailAddressCollection
Set(ByVal value As Mail.MailAddressCollection)
_BccCollection = value
End Set
End Property

Now I have a function named Email_Send()

Public Function Email_Send()

Dim email As New System.Net.Mail.MailMessage
email.Bcc = _Bcc
...

End Function

I am getting an error in "email.Bcc = _Bcc".

I know I should do something like email.Bcc.Add( addresses )

But if I am passing a collection ...

Maybe I am also following a wrong method to create this.

Can someone help me out?

Thanks,

Miguel
 
If you are passing a collection, you are correct. You simply overwrite the
inner value (private var). You should still have an Add method, however.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************************************************
Think outside of the box!
*************************************************
 
Back
Top