Out of Memory error in Outlook 2007 form
I have a form with a listbox, a textbox, and a button. I paste a multi-line chunk of text into the textbox and push the button to parse the text into a listbox.
I us the following code:
[VBA]Private Sub cmdQuickAdd_Click()
Dim sTmp As String, iPos1 As Integer, iPos2 As Integer
sTmp = txtQuickAdd.Text
iPos1 = 1
iPos2 = InStr(sTmp, vbCrLf)
Do While iPos2
lstTasks.AddItem Mid$(sTmp, iPos1, iPos2 - iPos1)
iPos1 = iPos2 + 2
iPos2 = InStr(iPos1, sTmp, vbCrLf)
Loop
End Sub[/VBA]
The first time the form runs, it seems to work fine. Subsequent loadings of the form result in Out of Memory errors that persist until I quit an restart Outlook 2007.
Any ideas? Can the textbox hold all the clipboard characters?