How to fix Length cannot be less than zero

May i know the value of strEmail and strAdd variable?
Also Try to Print Both Values in Separate Message Box Like
Write This Value in First Message Box in_pdfText.IndexOf(strEmail)
Write this value in Second Message Box in_pdfText.IndexOf(strAdd)-in_pdfText.IndexOf(strEmail).

How do I fix this error: Assign - Get filename: Length cannot be less than zero. (Parameter ‘length’)

File.Name.Substring(0, File.Name.LastIndexOf("."c))

Don’t name a variable File. File is a class. Change the name of your variable, and if the error still happens then it means your variable doesn’t contain a value.

Hello, I figured out what I was getting the error. I had a miss type in my first Assign “new FileInfo(InvoicesDirectory)” it should have been “new FileInfo(Invoice)”.

Thank you for your help.