I can't see the code you have executing but the question is WHEN does the userform associated with doc2 initialised? If it initialises and populates the userform prior to the next line of code running then I would expect the userform for doc2 to show the initial value rather than the updated line
Set doc2 = Application.Documents.Add("C:\XXXX.dotm")
'does the userform load here or does it wait for the next line before loading it?
doc2.Variables("myinitials").Value = Me.TxtYourInitials.Value
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
|