It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.
'Macro in standard module: Public Sub CreateLetter() Dim doc As Word.Document Set doc = Application.Documents.Add(strWorkgroup & "Letter.dot") ' "Do stuff" with the resulting document: Call MsgBox(doc.Name) '--> RTE: Object variable or with block variable not Set ' and stepping through the code, I can see that ' the doc variable is indeed Nothing End Sub 'Event in Letter.dot: Private Sub Document_New() Dim f As frmLetter Set f = New frmLetter With f Set .CurrentDocument = ActiveDocument .Show 'After cmdOK_Click, frmLetter processes its CurrentDocument correctly End With Set f = Nothing End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.