Att: Malcolm Smith

D

Dave Neve

Hi

Thanks for the Web lesson which I'm working my way through.

I've noticed that when I open my .dot, (saved as per your instructions) the
program runs and the VB userform appears.

But when I copied it elsewhere as a simple .doc, it doesn't run. (I copied
it for ease of access)

Since the VB instructions don't make reference to .dot, I don't understand
why the program runs when opened from .dot but not from .doc as the two
documents are exactly the same otherwise.

Also, Inspite of your explanations, I still haven't really got my head
around 'code'
yet and I was wondering if you could explain it again in other words.
(mailnly the oForm and the Oform.Tag = cancel
Private Sub Document_New()

Dim oForm As frmMemo
Set oForm = New frmMemo
oForm.Tag = "Cancel"
oForm.txtDate.Text = Format$(Date, "d mmmm yyyy")
oForm.Show

End Sub

Finally, I'd also like to ask the same question as a few days ago.

What is the relationship between the active document and ThisDocument in
VBA?

Thanks
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Dave,

When you create a new document from a template, the Document_New event
fires. When you open a document, there is no new document being created so
the Document_New event does not fire.

You should probably stick with working with the template. However, if you
change the name of the sub to Document_Open, then it will fire when the
document is opened.

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top