RE: Macro won't run on "read only" document. by wendeclare
wendeclare
Mon Feb 05 10:59:02 CST 2007
This is one of the macros. I recorded it rather than actually typing it in.
Do you mean save it elsewhere, assigning the macros, and then overwriting the
old document?
Sub QSD()
'
' QSD Macro
' Macro recorded 12/7/2006 by PMI
'
Selection.EndKey Unit:=wdStory, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=3, Extend:=wdExtend
Selection.Sort ExcludeHeader:=False, FieldNumber:="Column 5", _
SortFieldType:=wdSortFieldAlphanumeric,
SortOrder:=wdSortOrderAscending, _
FieldNumber2:="", SortFieldType2:=wdSortFieldAlphanumeric,
SortOrder2:= _
wdSortOrderAscending, FieldNumber3:="", SortFieldType3:= _
wdSortFieldAlphanumeric, SortOrder3:=wdSortOrderAscending,
Separator:= _
wdSortSeparateByCommas, SortColumn:=False, CaseSensitive:=False, _
LanguageID:=wdEnglishUS, SubFieldNumber:="Paragraphs",
SubFieldNumber2:= _
"Paragraphs", SubFieldNumber3:="Paragraphs"
Selection.HomeKey Unit:=wdStory
End Sub
--
Thank you.
"Wraithchilde" wrote:
> I think I'd need to actually see the macro and need more information on how
> you're using it, but you could try unprotecting the document in the beginning
> of the macro and protecting it again at the end.