Thanks! That's what I was looking for. vs.PutFile(commentStr, defaultStr): return fileName returns a complete Path. Is there a known reason why i can't use vs.SaveActiveDocument(filePath): with this Path? I know I can't use SaveActiveDocument inside the Dialog, so I've put this line in the Main part, after the dialog is closed with OK.