Click here to Skip to main content
15,896,505 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Don't what is the error in my code thats not worked any idea? Pin
N a v a n e e t h3-Jul-08 15:47
N a v a n e e t h3-Jul-08 15:47 
AnswerRe: Don't what is the error in my code thats not worked any idea? Pin
Chinners3-Jul-08 1:27
Chinners3-Jul-08 1:27 
Questionwhats is the mistacks in code thats insert data in oracle with vb.net Pin
idsanjeevjha2-Jul-08 20:25
idsanjeevjha2-Jul-08 20:25 
AnswerRe: whats is the mistacks in code thats insert data in oracle with vb.net Pin
Chinners2-Jul-08 23:37
Chinners2-Jul-08 23:37 
GeneralRe: whats is the mistacks in code thats insert data in oracle with vb.net Pin
idsanjeevjha3-Jul-08 0:53
idsanjeevjha3-Jul-08 0:53 
GeneralRe: whats is the mistacks in code thats insert data in oracle with vb.net Pin
Chinners3-Jul-08 1:24
Chinners3-Jul-08 1:24 
QuestionAxShockwaveFlash Object Pin
~V~2-Jul-08 20:04
~V~2-Jul-08 20:04 
QuestionException Handling Problem Pin
RCoate2-Jul-08 17:10
RCoate2-Jul-08 17:10 
I have some code that reads email items and their attachments and then moves the mail item to a "Processed" folder in the users mail box. In general it works ok, but if the attachment in a file type that is not recognised (this raises an error), I want to identify the mail item and move it to a different folder. When I debug my code, the appropriate catch statements seem to get called and the flags set correctly, but when I get the part of the code that moves the mail items, the one that raised the error gets moved into the "Processed" folder and not the "Failed" folder.

Can anyone see what I am doing wrong?

In the code below, theMailItem is a structure.
I.E.
<br />
    Public Structure TheMailItem<br />
        Dim theItem As MailItem<br />
        Dim theMove As Boolean<br />
        Dim theFail As Boolean<br />
    End Structure<br />


For Each theMailItem In theMailItems
    Try
        ReadMailItem(theMailItem.theItem)

    Catch ex As InvalidCastException
        theMailItem.theFail = True
        theMailItem.theMove = False

    Catch ex As NullReferenceException
        theMailItem.theFail = True
        theMailItem.theMove = False

    Catch ex As System.Exception
        theMailItem.theFail = True
        theMailItem.theMove = False

    End Try
Next

For Each theMailItem In theMailItems
    'Move any processed items
    If theMailItem.theMove = True Then
        theMailItem.theItem.Move(theMoveFolder)
    End If
    'Move any fail items
    If theMailItem.theFail = True Then
        theMailItem.theItem.Move(theFailedFolder)
    End If
Next

AnswerRe: Exception Handling Problem Pin
Mycroft Holmes2-Jul-08 17:21
professionalMycroft Holmes2-Jul-08 17:21 
GeneralRe: Exception Handling Problem Pin
RCoate2-Jul-08 17:46
RCoate2-Jul-08 17:46 
GeneralRe: Exception Handling Problem Pin
Mycroft Holmes2-Jul-08 18:17
professionalMycroft Holmes2-Jul-08 18:17 
GeneralRe: Exception Handling Problem Pin
Paul Conrad2-Jul-08 18:32
professionalPaul Conrad2-Jul-08 18:32 
AnswerRe: Exception Handling Problem Pin
Gideon Engelberth2-Jul-08 17:52
Gideon Engelberth2-Jul-08 17:52 
GeneralRe: Exception Handling Problem [modified] Pin
RCoate2-Jul-08 18:02
RCoate2-Jul-08 18:02 
QuestionVBscript, CreateFolder & Scheduler confusion. Pin
Member 37212832-Jul-08 7:01
Member 37212832-Jul-08 7:01 
AnswerRe: VBscript, CreateFolder & Scheduler confusion. Pin
Dave Kreskowiak2-Jul-08 7:14
mveDave Kreskowiak2-Jul-08 7:14 
GeneralRe: VBscript, CreateFolder & Scheduler confusion. Pin
Member 37212832-Jul-08 20:26
Member 37212832-Jul-08 20:26 
Questiontimer vs thread Pin
Ebube2-Jul-08 5:58
Ebube2-Jul-08 5:58 
AnswerRe: timer vs thread Pin
Dave Kreskowiak2-Jul-08 7:12
mveDave Kreskowiak2-Jul-08 7:12 
AnswerRe: timer vs thread Pin
Ebube2-Jul-08 7:15
Ebube2-Jul-08 7:15 
GeneralRe: timer vs thread Pin
Luc Pattyn2-Jul-08 7:42
sitebuilderLuc Pattyn2-Jul-08 7:42 
AnswerRe: timer vs thread Pin
KarstenK3-Jul-08 1:12
mveKarstenK3-Jul-08 1:12 
QuestionVBA/Excel Pin
torgerjl2-Jul-08 3:53
torgerjl2-Jul-08 3:53 
AnswerRe: VBA/Excel Pin
RCoate2-Jul-08 17:13
RCoate2-Jul-08 17:13 
AnswerRe: VBA/Excel Pin
Andy_L_J2-Jul-08 22:35
Andy_L_J2-Jul-08 22:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.