Hi
my program crashes when I want to load (a lot!) of email adresses in the BCC.
can someone tell me if Im doing something wrong (or is this a bug)
here's my code;
first, i select all of the items in the listview:
put all the emailadresses in a string, like:
then I "klik n send"
this is the message:
An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in system.dll
Additional information: Access is denied
the Green marked code is:
System.Diagnostics.Process.Start("mailto: ?BCC=" & strToAddress & "&Subject=" & strSubject & " ")
When I click a few (around 85) myself, All goes OK
(Outlook opens and puts all the emailadresses in the BCC and fills in the subject.)
someone?
my program crashes when I want to load (a lot!) of email adresses in the BCC.
can someone tell me if Im doing something wrong (or is this a bug)
here's my code;
first, i select all of the items in the listview:
VB.NET:
[SIZE=2][COLOR=#0000ff]
Dim[/COLOR][/SIZE][SIZE=2] X, intLstCount [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Integer
[/COLOR][/SIZE][SIZE=2]intLstCount = [/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].lstView.Items.Count - 1
[/SIZE][SIZE=2][COLOR=#0000ff]For[/COLOR][/SIZE][SIZE=2] X = 0 [/SIZE][SIZE=2][COLOR=#0000ff]To[/COLOR][/SIZE][SIZE=2] intLstCount
lstView.Items(X).Selected = [/SIZE][SIZE=2][COLOR=#0000ff]True
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Next[/COLOR][/SIZE][SIZE=2] X
[/SIZE]
put all the emailadresses in a string, like:
VB.NET:
[SIZE=2][COLOR=#0000ff]
Private[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] lstView_SelectedIndexChanged([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] sender [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.Object, [/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] e [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.EventArgs) [/SIZE][SIZE=2][COLOR=#0000ff]Handles[/COLOR][/SIZE][SIZE=2] lstView.SelectedIndexChanged
strEmailto = ""
[/SIZE][SIZE=2][COLOR=#008000]'loop through the selected items and put in string seperated with ;
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]For[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Each[/COLOR][/SIZE][SIZE=2] lvitem [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] ListViewItem [/SIZE][SIZE=2][COLOR=#0000ff]In[/COLOR][/SIZE][SIZE=2] lstView.SelectedItems
strEmailto = strEmailto & lvitem.SubItems(1).Text & ";"
[/SIZE][SIZE=2][COLOR=#0000ff]Next
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].lblStatus1.Text = [/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].lstView.SelectedItems.Count.ToString() & " van " & lstView.Items.Count & " cursisten geselecteerd."
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub
[/COLOR][/SIZE]
then I "klik n send"
VB.NET:
[SIZE=2][COLOR=#0000ff]
Dim[/COLOR][/SIZE][SIZE=2] strToAddress, strSubject [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String
[/COLOR][/SIZE][SIZE=2]strToAddress = strEmailto
strSubject = [/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].txtSubject.Text
[/SIZE][SIZE=2][COLOR=#008000][COLOR=black]System.Diagnostics.Process.Start("mailto: ?BCC=" & strToAddress & "&Subject=" & strSubject & " ")[/COLOR]
[/COLOR][/SIZE]
this is the message:
An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in system.dll
Additional information: Access is denied
the Green marked code is:
System.Diagnostics.Process.Start("mailto: ?BCC=" & strToAddress & "&Subject=" & strSubject & " ")
When I click a few (around 85) myself, All goes OK
(Outlook opens and puts all the emailadresses in the BCC and fills in the subject.)
someone?