Do you have 1 drawing with 40 layouts, or 40 individual drawings?
We have some metadata (I didn't write it) where you can update the properties box of it and it automatically puts the info on to the drawing, such as file path, author, date, invoice code etc. But that'll only work if you have 1 drawing with 40 layouts.