You need to declare and instantiante the db, newnote and doc variables. This will get you past the first error, Your code will then bomb on the line after the error unless you set doc = to something (like you did with the newnote, you must set the doc = to a notes document (like the current document) in order to get the value of the Subject field).
Dim session As New NotesSession
Dim db as NotesDatabase
DIm newnote as NotesDocument
Set db = s.CurrentDatabase
Set newnote = New NotesDocument(db)<—-(Error)
newnote.Subject = “Subject: ” & doc.YourSubjectField(0)