#1   Report Post  
Posted to microsoft.public.word.docmanagement
Jill D
 
Posts: n/a
Default Template disappears

I created a userform for my template but when I fill it out and hit ok the
whole template disappears and Word sends me into a new document. Why does
this happen and how can I fix it?

Thanks,
Jill
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman
 
Posts: n/a
Default Template disappears

On Tue, 15 Nov 2005 15:12:02 -0800, Jill D
wrote:

I created a userform for my template but when I fill it out and hit ok the
whole template disappears and Word sends me into a new document. Why does
this happen and how can I fix it?

Thanks,
Jill


Remember my answer in your other thread, that there's no way to tell
without seeing the code? Well.... ditto. We need to know what you told
Word you wanted it to do. Post back and include both the code of the
macro that displays the userform, and the code in the userform itself.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Jill D
 
Posts: n/a
Default Template disappears

I would cut and paste it but it won't let me into the template so here goes,
if I have to fix the code, how would I get back into the template, if it
won't let me?:

This is for the Userform:

Private Sub Document_New()

Dim oForm As frmDismissal

On Error Goto Error_DocumentNew

Set oForm = New frmDismissal
oForm.Tag = "Cancel"
oForm.txtDate.Text = Format$(Date, "mm/dd/yyyy")
oForm.Show

If oForm.Tag = "OK" Then
ActiveDocument.Bookmarks("ClientName").Range.Text = oForm.txtClientName.Text
ActiveDocument.Bookmarks("PetName").Range.Text = oForm.txtPetName.Text
ActiveDocument.Bookmarks("Doctor").Range.Text = oForm.txtDoctor.Text
ActiveDocument.Bookmarks("Date").Range.Text = oForm.txtDate.Text

Unload oForm
Set oForm = Nothing
Else
Unload oForm
Set oForm = Nothing
ActiveDocument.Close wdDoNotSaveChanges
End If

Exit_DocumentNew:

Exit Sub

Error_DocumentNew:
On Error Resume Next

Unload oForm
Set oForm = Nothing
ActiveDocument.Close wdDoNotSaveChanges

Resume Exit_DocumentNew

End Sub



Here's the next one (for the cancel button):

Option Explicit

Private Sub cmdCancel_Click()

Me.Hide

End Sub


Here's the ok button:

Private Sub cmdOK_Click()

Me.Tag = "OK"
Me.Hide

End Sub

Thanks for all your help!!!

Jill


I created a userform for my template but when I fill it out and hit ok the
whole template disappears and Word sends me into a new document. Why does
this happen and how can I fix it?

Thanks,
Jill


Remember my answer in your other thread, that there's no way to tell
without seeing the code? Well.... ditto. We need to know what you told
Word you wanted it to do. Post back and include both the code of the
macro that displays the userform, and the code in the userform itself.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org

  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill
 
Posts: n/a
Default Template disappears

In addition, you might want to be aware that there is a separate NG devoted
entirely to UserForms:
news://msnews.microsoft.com/microsof....vba.userforms or
http://www.microsoft.com/communities...ba.userform s

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Jay Freedman" wrote in message
...
On Tue, 15 Nov 2005 15:12:02 -0800, Jill D
wrote:

I created a userform for my template but when I fill it out and hit ok

the
whole template disappears and Word sends me into a new document. Why does
this happen and how can I fix it?

Thanks,
Jill


Remember my answer in your other thread, that there's no way to tell
without seeing the code? Well.... ditto. We need to know what you told
Word you wanted it to do. Post back and include both the code of the
macro that displays the userform, and the code in the userform itself.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
template disappears Jill D Microsoft Word Help 0 November 15th 05 11:10 PM
Global/Master Template [email protected] New Users 1 October 27th 05 03:34 PM
MS Word should support inheritence with regard to templates Ian Microsoft Word Help 3 October 6th 05 05:21 PM
CPU Usage When Working with Templates you created KM1 Microsoft Word Help 3 May 21st 05 11:57 PM
Bring custom toolbars with templates art Page Layout 2 January 21st 05 05:35 PM


All times are GMT +1. The time now is 03:00 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"