Try
Dim strFiles = Directory.GetFiles(GlobalVariables.strFolderPath)
Dim FileName As String
'Get Count of Files in Directory
Dim strCnt = My.Computer.FileSystem.GetFiles(GlobalVariables.strFolderPath).Count
Dim FileConnection As String = ""
For Each FileName In strFiles
If strCnt < 2 Then
If FileName = "Covernote.pdf" Then
'Cover Note Email - Does not work at present
ElseIf FileName = "Quotation.pdf" Then
'Quotation Email - Does not work at present
Else
FailedEmail("1 Attachment Only - Unknown Type", "There is only one attachment, this must either be a Covernote or a Quotation")
End If
Else
If FileName = "Welcome.pdf" Or FileName = "Cover_Letter_PC.pdf" Then
'Do New Business
ElseIf FileName = "Renew.pdf" Or FileName = "Renewed.pdf" Then
'Do Renewal / Transfrd NB
Else
'FailedEmail("Unknown Letter Type", "Unable to find a 'Main Letter' Type these can be <br><br>Welcome.pdf<br>Cover_Letter_PC.pdf<br>Renew.pdf<br>Renewed.pdf")
End If
End If
Next
Catch ex As Exception
MessageBox.Show(ex.Message, "Main Processing", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1)
WriteToLog(ex.Message)
End Try
If Exists(Directory.GetFIles) = "Renew.pdf" = True Then 'Do This End If
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE