Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Mark Mark is offline
external usenet poster
 
Posts: 182
Default Two questions about Word UserForms

Question 1.

I am using the following UserForm in a word document:

Private Sub CommandButton1_Click()

With ActiveDocument
.Bookmarks("Report_Number").Range _
.InsertBefore TextBox1
.Bookmarks("Date").Range _
.InsertBefore TextBox2
.Bookmarks("Location").Range _
.InsertBefore TextBox3
.Bookmarks("Spool_Details").Range _
.InsertBefore TextBox4
.Bookmarks("Pump_Pressure").Range _
.InsertBefore TextBox5

End With

I would like to use a Combo Box to add additional questions on the UserForm
with set answers contained in the Combo Box which would be placed at the
relevant bookmark location. How do I go about this?


Question 2.

In the same UserForm, I would like to add a yes/no question or a macro
button. If the answer is yes or the macro button is clicked, then the
document would create a second page identical to the first, with all the
bookmarked information included. If the answer was no or the macro button
left unclicked, then just the original page as laid out in the template would
be created with the contents of the bookmarked information included.

Is this possible, and if so how do I go about it?
  #2   Report Post  
Posted to microsoft.public.word.docmanagement,microsoft.public.word.vba.userforms
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default Two questions about Word UserForms

This is an end user NG; you're much more likely to get the help you need on
UserForms in microsoft.public.word.vba.userforms, to which I am
cross-posting this message.

--
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.

"Mark" wrote in message
...
Question 1.

I am using the following UserForm in a word document:

Private Sub CommandButton1_Click()

With ActiveDocument
.Bookmarks("Report_Number").Range _
.InsertBefore TextBox1
.Bookmarks("Date").Range _
.InsertBefore TextBox2
.Bookmarks("Location").Range _
.InsertBefore TextBox3
.Bookmarks("Spool_Details").Range _
.InsertBefore TextBox4
.Bookmarks("Pump_Pressure").Range _
.InsertBefore TextBox5

End With

I would like to use a Combo Box to add additional questions on the

UserForm
with set answers contained in the Combo Box which would be placed at the
relevant bookmark location. How do I go about this?


Question 2.

In the same UserForm, I would like to add a yes/no question or a macro
button. If the answer is yes or the macro button is clicked, then the
document would create a second page identical to the first, with all the
bookmarked information included. If the answer was no or the macro button
left unclicked, then just the original page as laid out in the template

would
be created with the contents of the bookmarked information included.

Is this possible, and if so how do I go about it?


  #3   Report Post  
Posted to microsoft.public.word.docmanagement,microsoft.public.word.vba.userforms
Mark Mark is offline
external usenet poster
 
Posts: 182
Default Two questions about Word UserForms

Could you give me a link to the place where you have cross posted, because
for the life of me, I cannot find it!

"Suzanne S. Barnhill" wrote:

This is an end user NG; you're much more likely to get the help you need on
UserForms in microsoft.public.word.vba.userforms, to which I am
cross-posting this message.

--
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.

"Mark" wrote in message
...
Question 1.

I am using the following UserForm in a word document:

Private Sub CommandButton1_Click()

With ActiveDocument
.Bookmarks("Report_Number").Range _
.InsertBefore TextBox1
.Bookmarks("Date").Range _
.InsertBefore TextBox2
.Bookmarks("Location").Range _
.InsertBefore TextBox3
.Bookmarks("Spool_Details").Range _
.InsertBefore TextBox4
.Bookmarks("Pump_Pressure").Range _
.InsertBefore TextBox5

End With

I would like to use a Combo Box to add additional questions on the

UserForm
with set answers contained in the Combo Box which would be placed at the
relevant bookmark location. How do I go about this?


Question 2.

In the same UserForm, I would like to add a yes/no question or a macro
button. If the answer is yes or the macro button is clicked, then the
document would create a second page identical to the first, with all the
bookmarked information included. If the answer was no or the macro button
left unclicked, then just the original page as laid out in the template

would
be created with the contents of the bookmarked information included.

Is this possible, and if so how do I go about it?



  #4   Report Post  
Posted to microsoft.public.word.docmanagement,microsoft.public.word.vba.userforms
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default Two questions about Word 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.

"Mark" wrote in message
...
Could you give me a link to the place where you have cross posted, because
for the life of me, I cannot find it!

"Suzanne S. Barnhill" wrote:

This is an end user NG; you're much more likely to get the help you need

on
UserForms in microsoft.public.word.vba.userforms, to which I am
cross-posting this message.

--
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.

"Mark" wrote in message
...
Question 1.

I am using the following UserForm in a word document:

Private Sub CommandButton1_Click()

With ActiveDocument
.Bookmarks("Report_Number").Range _
.InsertBefore TextBox1
.Bookmarks("Date").Range _
.InsertBefore TextBox2
.Bookmarks("Location").Range _
.InsertBefore TextBox3
.Bookmarks("Spool_Details").Range _
.InsertBefore TextBox4
.Bookmarks("Pump_Pressure").Range _
.InsertBefore TextBox5

End With

I would like to use a Combo Box to add additional questions on the

UserForm
with set answers contained in the Combo Box which would be placed at

the
relevant bookmark location. How do I go about this?


Question 2.

In the same UserForm, I would like to add a yes/no question or a macro
button. If the answer is yes or the macro button is clicked, then the
document would create a second page identical to the first, with all

the
bookmarked information included. If the answer was no or the macro

button
left unclicked, then just the original page as laid out in the

template
would
be created with the contents of the bookmarked information included.

Is this possible, and if so how do I go about it?




  #5   Report Post  
Posted to microsoft.public.word.docmanagement,microsoft.public.word.vba.userforms
Mark Mark is offline
external usenet poster
 
Posts: 182
Default Two questions about Word UserForms

OK, here I am, so can anyone help with my two questions?

"Mark" wrote in message
...
Question 1.

I am using the following UserForm in a word document:

Private Sub CommandButton1_Click()

With ActiveDocument
.Bookmarks("Report_Number").Range _
.InsertBefore TextBox1
.Bookmarks("Date").Range _
.InsertBefore TextBox2
.Bookmarks("Location").Range _
.InsertBefore TextBox3
.Bookmarks("Spool_Details").Range _
.InsertBefore TextBox4
.Bookmarks("Pump_Pressure").Range _
.InsertBefore TextBox5

End With

I would like to use a Combo Box to add additional questions on the
UserForm
with set answers contained in the Combo Box which would be placed at

the
relevant bookmark location. How do I go about this?


Question 2.

In the same UserForm, I would like to add a yes/no question or a macro
button. If the answer is yes or the macro button is clicked, then the
document would create a second page identical to the first, with all

the
bookmarked information included. If the answer was no or the macro

button
left unclicked, then just the original page as laid out in the

template
would
be created with the contents of the bookmarked information included.

Is this possible, and if so how do I go about it?






  #6   Report Post  
Posted to microsoft.public.word.docmanagement,microsoft.public.word.vba.userforms
Jonathan West Jonathan West is offline
external usenet poster
 
Posts: 25
Default Two questions about Word UserForms


Question 1.

I am using the following UserForm in a word document:

Private Sub CommandButton1_Click()

With ActiveDocument
.Bookmarks("Report_Number").Range _
.InsertBefore TextBox1
.Bookmarks("Date").Range _
.InsertBefore TextBox2
.Bookmarks("Location").Range _
.InsertBefore TextBox3
.Bookmarks("Spool_Details").Range _
.InsertBefore TextBox4
.Bookmarks("Pump_Pressure").Range _
.InsertBefore TextBox5

End With

I would like to use a Combo Box to add additional questions on the

UserForm
with set answers contained in the Combo Box which would be placed at the
relevant bookmark location. How do I go about this?


In the UserForm_Initialize event, you have to populate the combobox, like
this

ComboBox1.List = Array("Apples", "Pears", "Bananas", "Lemons", "Grapefruit")

It might be an idea to set the ListIndex property of the combobox to 0 to
ensure that something is guaranteed to be selected.

Then in the CommandButton1_Click, you do something like this to insert the
selected item into the document

With ActiveDocument
.Bookmarks("Fruit").Range _
.InsertBefore ComboBox1.Text
End With



Question 2.

In the same UserForm, I would like to add a yes/no question or a macro
button. If the answer is yes or the macro button is clicked, then the
document would create a second page identical to the first, with all the
bookmarked information included. If the answer was no or the macro button
left unclicked, then just the original page as laid out in the template

would
be created with the contents of the bookmarked information included.

Is this possible, and if so how do I go about it?


Not sure I understand you. Do you want a second page with the information
duplicated as you have already entered on the UserForm, or do you want to be
able to run the UserForm again and insert a new lot of information?


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

  #7   Report Post  
Posted to microsoft.public.word.docmanagement,microsoft.public.word.vba.userforms
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Two questions about Word UserForms

.Bookmarks("Report_Number").Range _
.InsertBefore ComboBox1.Value

I suggest that you give meaningful names to the controls on your userform.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Mark" wrote in message
...
OK, here I am, so can anyone help with my two questions?

"Mark" wrote in message
...
Question 1.

I am using the following UserForm in a word document:

Private Sub CommandButton1_Click()

With ActiveDocument
.Bookmarks("Report_Number").Range _
.InsertBefore TextBox1
.Bookmarks("Date").Range _
.InsertBefore TextBox2
.Bookmarks("Location").Range _
.InsertBefore TextBox3
.Bookmarks("Spool_Details").Range _
.InsertBefore TextBox4
.Bookmarks("Pump_Pressure").Range _
.InsertBefore TextBox5

End With

I would like to use a Combo Box to add additional questions on the
UserForm
with set answers contained in the Combo Box which would be placed
at

the
relevant bookmark location. How do I go about this?


Question 2.

In the same UserForm, I would like to add a yes/no question or a
macro
button. If the answer is yes or the macro button is clicked, then
the
document would create a second page identical to the first, with
all

the
bookmarked information included. If the answer was no or the macro

button
left unclicked, then just the original page as laid out in the

template
would
be created with the contents of the bookmarked information
included.

Is this possible, and if so how do I go about it?






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
Why dont MS just f**king re-write Word from scratch? Its dogsh*t Word Hater Microsoft Word Help 33 May 5th 23 02:52 PM
How to put graphics on envelopes? Steve Koenig Microsoft Word Help 21 April 29th 23 02:47 AM
Change paper size; Word changes to invalid margins OhioTech New Users 10 July 6th 06 02:00 PM
Word & WordPerfect MrsMac Microsoft Word Help 5 June 10th 06 03:14 AM
How can Word display full path of a file in the title bar? SAsif Microsoft Word Help 1 January 26th 06 04:32 PM


All times are GMT +1. The time now is 04:43 PM.

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"