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 / Tables / February 2006

Tip: Looking for answers? Try searching our database.

Freeze row height then put button to view entire cell

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Graham Smith 450-458-0101 - 24 Feb 2006 14:19 GMT
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

graham@cowaninternational.com
Cooz - 24 Feb 2006 15:41 GMT
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.

> 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
[quoted text clipped - 9 lines]
>
> graham@cowaninternational.com
Graham Smith 450-458-0101 - 24 Feb 2006 16:01 GMT
Thanks.  I'll try your suggestion.  One question: What's a macro? (just joking)

> Hi Graham,
>
[quoted text clipped - 36 lines]
> >
> > graham@cowaninternational.com
Greg - 24 Feb 2006 16:12 GMT
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
Greg - 24 Feb 2006 16:24 GMT
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
Graham Smith 450-458-0101 - 24 Feb 2006 16:45 GMT
Thanks

> Just a bell and whistle, but you could also toggle the macrobutton text
> between show and hide:
[quoted text clipped - 13 lines]
> End With
> End Sub
Cooz - 27 Feb 2006 14:38 GMT
Yep.
:-)

> Just a bell and whistle, but you could also toggle the macrobutton text
> between show and hide:
[quoted text clipped - 13 lines]
> End With
> End Sub
 
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.