If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Freeze row height then put button to view entire cell
I am creating a script/questionaire that will be used by different people. I
would like to create a form Word Table where I could enter a question in one cell then wrap the text in the answer cell, allow the person who is writing the answer to use as man lines as they want but freeze the height of the answer cell (to 3 lines) - THEN put a 'button' on/near the answer cell that would allow someone viewing the completed questionaire to choose wether they want to view the entire answer.... phew. I've got everything done (thanks to the forum) except for the 'putting the button on/near the cell to view the entire contents' part. I know I can just select the cell and go to row - auto fit but is there another way. Thanks |
#2
|
|||
|
|||
Freeze row height then put button to view entire cell
Hi Graham,
Yes, there is. Place the following macro in your document: Sub ViewAnswer() Selection.Rows(1).HeightRule = wdRowHeightAuto End Sub You can do this by recording any macro in your document, choose Tools | Macro Macro's - edit the macro and replace with the one above. Add a column to your table. In every cell of this column, place the following field: { MACROBUTTON ViewAnswer Doubleclick to view answer } Be sure to insert the { } by pressing Ctrl-F9. Type the rest. Whenever a user docubleclicks the Macrobutton field, the current row height is set to auto fit. Good luck, Cooz -- PS: If this is a satisfying answer to your question and you're logged in via the Microsoft site, please click Yes to "Did this post answer the question?". Thanks. "Graham Smith 450-458-0101" wrote: I am creating a script/questionaire that will be used by different people. I would like to create a form Word Table where I could enter a question in one cell then wrap the text in the answer cell, allow the person who is writing the answer to use as man lines as they want but freeze the height of the answer cell (to 3 lines) - THEN put a 'button' on/near the answer cell that would allow someone viewing the completed questionaire to choose wether they want to view the entire answer.... phew. I've got everything done (thanks to the forum) except for the 'putting the button on/near the cell to view the entire contents' part. I know I can just select the cell and go to row - auto fit but is there another way. Thanks |
#3
|
|||
|
|||
Freeze row height then put button to view entire cell
Thanks. I'll try your suggestion. One question: What's a macro? (just joking)
"Cooz" wrote: Hi Graham, Yes, there is. Place the following macro in your document: Sub ViewAnswer() Selection.Rows(1).HeightRule = wdRowHeightAuto End Sub You can do this by recording any macro in your document, choose Tools | Macro Macro's - edit the macro and replace with the one above. Add a column to your table. In every cell of this column, place the following field: { MACROBUTTON ViewAnswer Doubleclick to view answer } Be sure to insert the { } by pressing Ctrl-F9. Type the rest. Whenever a user docubleclicks the Macrobutton field, the current row height is set to auto fit. Good luck, Cooz -- PS: If this is a satisfying answer to your question and you're logged in via the Microsoft site, please click Yes to "Did this post answer the question?". Thanks. "Graham Smith 450-458-0101" wrote: I am creating a script/questionaire that will be used by different people. I would like to create a form Word Table where I could enter a question in one cell then wrap the text in the answer cell, allow the person who is writing the answer to use as man lines as they want but freeze the height of the answer cell (to 3 lines) - THEN put a 'button' on/near the answer cell that would allow someone viewing the completed questionaire to choose wether they want to view the entire answer.... phew. I've got everything done (thanks to the forum) except for the 'putting the button on/near the cell to view the entire contents' part. I know I can just select the cell and go to row - auto fit but is there another way. Thanks |
#4
|
|||
|
|||
Freeze row height then put button to view entire cell
Cooz,
Seems to me that a toggle would be more appropriate: Sub ViewAnswerToggle() If Selection.Rows(1).HeightRule = wdRowHeightExactly Then Selection.Rows(1).HeightRule = wdRowHeightAuto Else With Selection.Rows(1) .HeightRule = wdRowHeightExactly .Height = "42" End With End If End Sub |
#5
|
|||
|
|||
Freeze row height then put button to view entire cell
Just a bell and whistle, but you could also toggle the macrobutton text
between show and hide: Sub ViewAnswerToggle() With Selection.Rows(1) If .HeightRule = wdRowHeightExactly Then .HeightRule = wdRowHeightAuto .Range.Fields(1).Code.Text = "MACROBUTTON ViewAnswerToggle ""Hide""" Else .HeightRule = wdRowHeightExactly .Height = "42" .Range.Fields(1).Code.Text = "MACROBUTTON ViewAnsWerToggle ""Show""" End If End With End Sub |
#6
|
|||
|
|||
Freeze row height then put button to view entire cell
Thanks
"Greg" wrote: Just a bell and whistle, but you could also toggle the macrobutton text between show and hide: Sub ViewAnswerToggle() With Selection.Rows(1) If .HeightRule = wdRowHeightExactly Then .HeightRule = wdRowHeightAuto .Range.Fields(1).Code.Text = "MACROBUTTON ViewAnswerToggle ""Hide""" Else .HeightRule = wdRowHeightExactly .Height = "42" .Range.Fields(1).Code.Text = "MACROBUTTON ViewAnsWerToggle ""Show""" End If End With End Sub |
#7
|
|||
|
|||
Freeze row height then put button to view entire cell
Yep.
:-) "Greg" wrote: Just a bell and whistle, but you could also toggle the macrobutton text between show and hide: Sub ViewAnswerToggle() With Selection.Rows(1) If .HeightRule = wdRowHeightExactly Then .HeightRule = wdRowHeightAuto .Range.Fields(1).Code.Text = "MACROBUTTON ViewAnswerToggle ""Hide""" Else .HeightRule = wdRowHeightExactly .Height = "42" .Range.Fields(1).Code.Text = "MACROBUTTON ViewAnsWerToggle ""Show""" End If End With End Sub |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
copying cell names | Al | General Discussion | 3 | August 11th, 2005 03:01 PM |
GET.CELL | Biff | Worksheet Functions | 2 | November 24th, 2004 07:16 PM |
IF E3 & E10 = TRUE set this cell to "Yes", else set to "No" | Timothy L | Worksheet Functions | 5 | August 27th, 2004 02:28 AM |
Day/Week/Month view and "Calendar Button" | Chrissie | Calendar | 2 | April 28th, 2004 05:31 PM |
Do you have what it takes... | darno | Worksheet Functions | 0 | February 22nd, 2004 08:01 PM |