H
Harvey Colwell
I'm redesigning a customer's file shares. Currently they have files
scattered across multiple servers. Because of disk space issues, related
files are often stored in different shares. Each user has up to 12 drive
mappings, no two exactly the same.
And access control is non-existent. Either the "Everyone" group was granted
Full Control, or they just add the person to the Domain Admins group.
I'm consolidating all of there current shares into a single master share
(think of DFS but actually moving the data) on a new file server. The new
server has plenty of space to grow. When we're done, they each user will
have only two drive mappings, a private home (H and work (W. Access is
being locked down with oodles of new groups and NTFS permissions.
My Problem:
They use a horde of hyperlinks to link to other office documents. A single
document often has 20 or more hyperlinks. I'm writing a macro that does a
Find/Replace to update Hyperlinks to point to the new location of moved
documents. As you can see, it's a simple for/next loop pulling from a
two-dimensional array to feed the find replace. The problem is the "Word has
finished searching the selection. # replacements were made. Do you want to
search the remainder of the document?" popup message. I have to press no for
each Find/Replace.
Is there a way to prevent this popup?
How can I pragmatically close it?
Is there a other way to do the Find/Replace?
Sub HyperLink_Fix()
Dim aLinks As Variant
aLinks = Array(Array("\\\\APTNT\\ASOI",
"\\\\FileSrv01\\Shares\\Production\\ASOI"), _
Array("", ""), _
Array("", "") _
)
Selection.WholeStory
Selection.Fields.ToggleShowCodes
For iIndex = 0 To UBound(aLinks)
With Selection.Find
.Text = aLinks(iIndex)(0)
.Replacement.Text = aLinks(iIndex)(1)
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Next
Selection.Fields.ToggleShowCodes
End Sub
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Harvey Colwell --- SDS, Inc
Web: http://www.sds400.com/
Tel: (217) 347-5242 Ext 14
Eml: (e-mail address removed)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
scattered across multiple servers. Because of disk space issues, related
files are often stored in different shares. Each user has up to 12 drive
mappings, no two exactly the same.
And access control is non-existent. Either the "Everyone" group was granted
Full Control, or they just add the person to the Domain Admins group.
I'm consolidating all of there current shares into a single master share
(think of DFS but actually moving the data) on a new file server. The new
server has plenty of space to grow. When we're done, they each user will
have only two drive mappings, a private home (H and work (W. Access is
being locked down with oodles of new groups and NTFS permissions.
My Problem:
They use a horde of hyperlinks to link to other office documents. A single
document often has 20 or more hyperlinks. I'm writing a macro that does a
Find/Replace to update Hyperlinks to point to the new location of moved
documents. As you can see, it's a simple for/next loop pulling from a
two-dimensional array to feed the find replace. The problem is the "Word has
finished searching the selection. # replacements were made. Do you want to
search the remainder of the document?" popup message. I have to press no for
each Find/Replace.
Is there a way to prevent this popup?
How can I pragmatically close it?
Is there a other way to do the Find/Replace?
Sub HyperLink_Fix()
Dim aLinks As Variant
aLinks = Array(Array("\\\\APTNT\\ASOI",
"\\\\FileSrv01\\Shares\\Production\\ASOI"), _
Array("", ""), _
Array("", "") _
)
Selection.WholeStory
Selection.Fields.ToggleShowCodes
For iIndex = 0 To UBound(aLinks)
With Selection.Find
.Text = aLinks(iIndex)(0)
.Replacement.Text = aLinks(iIndex)(1)
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Next
Selection.Fields.ToggleShowCodes
End Sub
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Harvey Colwell --- SDS, Inc
Web: http://www.sds400.com/
Tel: (217) 347-5242 Ext 14
Eml: (e-mail address removed)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-