I'm new here but macro-wise I have a bit of hindsight So maybe I can help you
for the story of the name of the sheet at the registration it must be happening somewhere by the swPathName = swPath + swName
In the swName variable you should be able to find the name of your PDF sheet Genre: toto.pdf
It is given at the level of line A: swName = Left(swName, InStrRev(swName, ".") - 1) so this is the line that you will have to modify to change the name of your file save as PDF
On the other hand, I don't have enough hindsight on the history of solidworks drawings