Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set f = objFSO.OpenTextFile("c:\hyperlinks.txt", 2 , True) 'file name’s to which links to be written
Set objDoc = objWord.Documents.Open("c:\Exercises.doc") 'Word document from which links have to be separated
Set colHyperlinks = objDoc.Hyperlinks
For Each objHyperlink in colHyperlinks
f.WriteLine(objHyperlink.Address)
Next
objWord.Visible = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set f = objFSO.OpenTextFile("c:\hyperlinks.txt", 2 , True) 'file name’s to which links to be written
Set objDoc = objWord.Documents.Open("c:\Exercises.doc") 'Word document from which links have to be separated
Set colHyperlinks = objDoc.Hyperlinks
For Each objHyperlink in colHyperlinks
f.WriteLine(objHyperlink.Address)
Next
No comments:
Post a Comment