Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.newusers
akkrug akkrug is offline
external usenet poster
 
Posts: 58
Default Sorting data in MS Word 2002

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.
--
akkrug
  #2   Report Post  
Posted to microsoft.public.word.newusers
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Sorting data in MS Word 2002

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.



  #3   Report Post  
Posted to microsoft.public.word.newusers
Amish Amish is offline
external usenet poster
 
Posts: 35
Default Sorting data in MS Word 2002

Are you using form fields? If so, you could trigger a macro when the
last item is exited that unlocks the form, sorts the table (Word will
sort form fields based on content), and then locks the form
afterwards.

On Jun 16, 8:45*am, 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.
--
akkrug


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

Thanks for the reply. I copied the macro to our form and added a button to
run it, but the information keyed isn't sorting. How do you tell it which
column to sort by?Does the (1) indicate the first column?

Please let me know if you have any other suggestions.

Thanks for the help!!

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




  #5   Report Post  
Posted to microsoft.public.word.newusers
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Sorting data in MS Word 2002

Perhaps if you were to tell us exactly how the table is laid out and how you
want it to be sorted it might avoid fishing around in the dark?
The 1 addresses the first table in the document.

--

Graham Mayor - Word MVP

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



akkrug wrote:
Thanks for the reply. I copied the macro to our form and added a
button to run it, but the information keyed isn't sorting. How do
you tell it which column to sort by?Does the (1) indicate the first
column?

Please let me know if you have any other suggestions.

Thanks for the help!!

Ken K.

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.





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




  #7   Report Post  
Posted to microsoft.public.word.newusers
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Sorting data in MS Word 2002

If the table is the first table in the document then it will be sorted by
the first column using the macro?
I have tested it with seven column tables configured as you describe, using
form fields in the cells and it works fine in both Word 2003 and 2007. I
don't have 2002 to test, but I see no reason why it should not work there.
There are no advanced techniques used in the macro that shouldn't have been
available before 2003.
--

Graham Mayor - Word MVP

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



akkrug wrote:
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

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.



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
fix crash problem with word sorting data for merge CD Tom Mailmerge 2 July 13th 09 05:55 AM
Sorting Merged Access Data in Word CCWMC Mailmerge 2 August 4th 08 08:24 PM
07 Crashes when Sorting Data Chris Lane Mailmerge 2 April 22nd 08 08:46 PM
tagging and sorting data in word Jon D Microsoft Word Help 4 July 11th 07 07:11 PM
Sorting Merged data Word and Access Angeloudaki Microsoft Word Help 1 June 17th 05 03:26 PM


All times are GMT +1. The time now is 07:31 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"