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 / Programming / February 2005

Tip: Looking for answers? Try searching our database.

Change Word Links via VBA ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mario Reiley - 21 Feb 2005 14:46 GMT
Hello Group,

I have a document in Word with Bonds to Excel. I need to change statements I
link using VBA.

For example:

My old Source Path
"C:\Source Project\My file.doc"

My New Source Path

and I want to change a part to
"C:\New Project\My file.doc"

Any advisor  will be Wellcome

Best Regard
Mario
Jean-Guy Marcil - 21 Feb 2005 15:59 GMT
Mario Reiley was telling us:
Mario Reiley nous racontait que :

> Hello Group,
>
[quoted text clipped - 10 lines]
> and I want to change a part to
> "C:\New Project\My file.doc"

Display all field codes, then find/replace all "C:\Source Project\" with
"C:\New Project\".

'_______________________________________
Application.ScreenUpdating = False

ActiveWindow.View.ShowFieldCodes = True

With Selection
   .Find.ClearFormatting
   .Find.Replacement.ClearFormatting
       With .Find
           .Text = "TIME"
           .Replacement.Text = "DATE"
           .Forward = True
           .Wrap = wdFindContinue
           .Format = False
           .MatchCase = False
           .MatchWholeWord = False
           .MatchWildcards = False
           .MatchSoundsLike = False
           .MatchAllWordForms = False
       End With
   .Find.Execute Replace:=wdReplaceAll
End With

ActiveWindow.View.ShowFieldCodes = False

Application.ScreenUpdating = True
Application.ScreenRefresh
'_______________________________________

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

 
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.