Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement,microsoft.public.word.vba.userforms
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement,microsoft.public.word.vba.userforms
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement,microsoft.public.word.vba.userforms
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement,microsoft.public.word.vba.userforms
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement,microsoft.public.word.vba.userforms
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement,microsoft.public.word.vba.userforms
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Why dont MS just f**king re-write Word from scratch? Its dogsh*t | Microsoft Word Help | |||
How to put graphics on envelopes? | Microsoft Word Help | |||
Change paper size; Word changes to invalid margins | New Users | |||
Word & WordPerfect | Microsoft Word Help | |||
How can Word display full path of a file in the title bar? | Microsoft Word Help |