Mid() is the method to return a value of a certain length. So Session1.caption is the string that is to be essentially cropped. 1 is the starting position and the rest is the end value. As the end value varies depending on where the carriage return is the following piece of coding finds that last value.
InStr() is looking for a string within a string returning the position value of the first occurance. So Session1.caption is the main string, carriage is the Carriage Return key (String 2) and the 1 means start from position 1.