Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2007

Tip: Looking for answers? Try searching our database.

userform on open + installed template = "no go"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
zSplash - 23 Jul 2007 22:37 GMT
In Word, I use a server template (which auto-installs when the form is
opened), but the use of a userform in the open_event seems to prevent the
template from running.

That is, without the userform in the open_event, the template runs just fine
after the form opens.
Even with a message box for input, the template runs just fine after the
form opens.

But, if I use a userform to get input (and then insert the input into the
form), the template does not run after the form opens.  (The template is
installed and checked.)

Can someone explain this to me (and help me resolve it)?

TIA
David Sisson - 24 Jul 2007 18:49 GMT
Show us the code in the Open Event.  Which module is it in?

How are you calling the template?  File -> New, select template

or File -> Open, select template?

> the template does not run after the form opens.
So, you're saying the macro starts, displays the Userform, you type in
some info into the userform, then that data is not making it to the
form?
zSplash - 27 Jul 2007 00:33 GMT
Thanks for responding.  No, the data makes it to the form, but the installed
addin doesn't run after the userform's input is saved to the Active
Document.

in the ThisDocument module:

Private Sub Document_New()      [and, also, for Document_Open event]
userform1.Show
End Sub

in the commandBox of userform1:

Private Sub commandBox_Enter()
userform1.hide
If opt1.value=true then
 ActiveDocument.FormFields("ckb1").CheckBox.Value = True
Else
 ActiveDocument.FormFields("ckb1").CheckBox.Value = False
End If
End Sub

And then the installed addin should proceed to run.  The installed addin, as
I said, runs great with a msgbox instead of userform1.

TIA
> Show us the code in the Open Event.  Which module is it in?
>
[quoted text clipped - 6 lines]
> some info into the userform, then that data is not making it to the
> form?
Russ - 27 Jul 2007 09:49 GMT
Does it make a difference if you hide the userform after adjusting the
formfields?

> Thanks for responding.  No, the data makes it to the form, but the installed
> addin doesn't run after the userform's input is saved to the Active
[quoted text clipped - 31 lines]
>> some info into the userform, then that data is not making it to the
>> form?

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

zSplash - 01 Aug 2007 09:35 GMT
Thanks, Russ.  No.  Immediately after getting the input, I hide the
userform.

st.

> Does it make a difference if you hide the userform after adjusting the
> formfields?
[quoted text clipped - 34 lines]
> >> some info into the userform, then that data is not making it to the
> >> form?
Russ - 01 Aug 2007 19:18 GMT
Private Sub commandBox_Enter()
userform1.hide
If opt1.value=true then
 ActiveDocument.FormFields("ckb1").CheckBox.Value = True
Else
 ActiveDocument.FormFields("ckb1").CheckBox.Value = False
End If
End Sub

So you did change this to hide after the if statement?

Private Sub commandBox_Enter()
If opt1.value=true then
 ActiveDocument.FormFields("ckb1").CheckBox.Value = True
Else
 ActiveDocument.FormFields("ckb1").CheckBox.Value = False
End If
userform1.hide
End Sub

> Thanks, Russ.  No.  Immediately after getting the input, I hide the
> userform.
[quoted text clipped - 41 lines]
>>>> some info into the userform, then that data is not making it to the
>>>> form?

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.