View Single Post
  #6   Report Post  
Posted to microsoft.public.word.newusers
akkrug akkrug is offline
external usenet poster
 
Posts: 58
Default Sorting data in MS Word 2002

All I want to do is sort a 7 column table by the first column (Agent Name).
Five of the columns are text and two are dates. I am now trying to do it in
Excel, but I don't know how to expand the cell height as information is keyed
into the cell.

Thanks for the help!

Ken K. - 2191
--
akkrug


"Graham Mayor" wrote:

Without seeing your table, something along the lines of the following macro
run from a toolbar button should work

Sub SortTable()
Dim bProtected As Boolean
If ActiveDocument.ProtectionType wdNoProtection Then
bProtected = True
ActiveDocument.Unprotect Password:=""
End If
ActiveDocument.Tables(1).Sort
If bProtected = True Then
ActiveDocument.Protect _
Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=""
End If
End Sub

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



akkrug wrote:
Our users want a fillable Word form, so I set up a simple table. Now
they want to be able to sort the information and I can't get it to
work. Even if I unprotect the form, select the table and use table,
sort nothing is happening. Any idea what I might be doing wrong?
Also, even if I could get the sort to work, I'm not sure if there is
any way to sort information when the cells are locked so information
can be keyed into them.

Thanks for the help!!

Ken K.