johnjames127
Technical User
We have a macro that allows us to save any received emails in certain folders on our network, which works well. When we receive an email message we double click on it the macro opens and we select a location to save it (a bit like windows explorer). The macro saves the email with the date when received, who it is from, subject and a .html or .txt extension.
strpath = FolderPath & strDateReceived & " " & strFrom & "; " & strEmailSubject & strExt
The problem is if the save location and file name exceed 256 characters the .html or .txt extension is not saved It only saves up to character number 256. So the email is just saved as a file which will not open and is not searchable, but if you manually rename it and place a extension the file opens no problem in windows.
I have a basic understanding of vba structure but not much coding experience, could an If statement be added somewhere in the code to check the number of characters before saving?
Cheers
strpath = FolderPath & strDateReceived & " " & strFrom & "; " & strEmailSubject & strExt
The problem is if the save location and file name exceed 256 characters the .html or .txt extension is not saved It only saves up to character number 256. So the email is just saved as a file which will not open and is not searchable, but if you manually rename it and place a extension the file opens no problem in windows.
I have a basic understanding of vba structure but not much coding experience, could an If statement be added somewhere in the code to check the number of characters before saving?
Cheers