ไปยังเนื้อหาหลัก

วิธีการเลือกและคัดลอกไฮเปอร์ลิงก์ทั้งหมดจากเอกสาร Word

ในบางกรณีคุณมีเอกสารขนาดยาวที่มีการเชื่อมโยงหลายมิติหลายรายการและคุณจะต้องคัดลอกไฮเปอร์ลิงก์ทั้งหมดพร้อมกันจากเอกสารนี้จากนั้นจึงวางลงในเอกสารอื่น มีวิธีใดบ้างที่สามารถคัดลอกทั้งหมดได้อย่างรวดเร็วในคราวเดียวแทนที่จะคัดลอกทีละรายการ

คัดลอกไฮเปอร์ลิงก์ทั้งหมดด้วย VBA

แยกที่อยู่ไฮเปอร์ลิงก์ทั้งหมดด้วย VBA

คัดลอกไฮเปอร์ลิงก์ทั้งหมดหรือเฉพาะที่อยู่ไปยังคลิปบอร์ดด้วย Kutools for Wordความคิดที่ดี 3


ลูกศรสีฟ้าฟองขวา คัดลอกไฮเปอร์ลิงก์ทั้งหมดด้วย VBA

1. เปิดเอกสาร Word ที่คุณต้องการคัดลอกไฮเปอร์ลิงก์แล้วกด Alt + F11 เพื่อเปิด หน้าต่างโปรแกรมประยุกต์ Microsoft Visual.

2 คลิก สิ่งที่ใส่เข้าไป > โมดูลและคัดลอก VBA ต่อไปนี้ลงในหน้าต่าง

VBA: คัดลอกไฮเปอร์ลิงก์ทั้งหมด

Sub HyperlinksExtract()
'Updateby20140214
    Dim oLink As Hyperlink
    Dim docCurrent As Document 'current document
    Dim docNew As Document 'new document
    Dim rngStory As StoryRanges
    Set docCurrent = ActiveDocument
    Set docNew = Documents.Add
    For Each oLink In docCurrent.Hyperlinks
        oLink.Range.Copy
        docNew.Activate
        Selection.Paste
        Selection.TypeParagraph
    Next
    
    Set docNew = Nothing
    Set docCurrent = Nothing
End Sub

3 คลิกที่ วิ่ง เพื่อเรียกใช้รหัส VBA จากนั้นไฮเปอร์ลิงก์ทั้งหมดจะถูกคัดลอกไปยังเอกสารใหม่ คุณสามารถบันทึกเอกสารใหม่ได้ในภายหลัง คุณสามารถดูผลลัพธ์ได้ดังนี้

หมายเหตุ VBA นี้สามารถทำงานได้ก็ต่อเมื่อไฮเปอร์ลิงก์ทั้งหมดเชื่อมโยงกับ word หากมีรูปภาพที่มีไฮเปอร์ลิงก์โค้ด VBA นี้จะไม่สามารถใช้งานได้


ลูกศรสีฟ้าฟองขวา แยกที่อยู่ไฮเปอร์ลิงก์ทั้งหมดด้วย VBA

1. เปิดเอกสาร Word ที่คุณต้องการแยกการเชื่อมโยงหลายมิติแล้วกด Alt + F11 เพื่อเปิด หน้าต่างโปรแกรมประยุกต์ Microsoft Visual.

2 คลิก สิ่งที่ใส่เข้าไป > โมดูลและคัดลอก VBA ต่อไปนี้ลงในหน้าต่าง

VBA: แยกที่อยู่ของไฮเปอร์ลิงก์ทั้งหมด

Function GetAllHyperlinks()
'Updateby20140214
    Dim docCurrent As Document
    Dim docNew As Document
    Dim oLink As Hyperlink
    Dim rng As Range
    Application.ScreenUpdating = False
    Set docCurrent = ActiveDocument
    Set docNew = Documents.Add
    For Each oLink In docCurrent.Hyperlinks
        Set rng = docNew.Range
        rng.Collapse
        rng.InsertParagraph
        rng.InsertAfter (oLink.Address)
    Next
    docNew.Activate
    Application.ScreenUpdating = True
    Application.ScreenRefresh
End Function

3 คลิกที่ วิ่ง เพื่อเรียกใช้รหัส VBA จากนั้นที่อยู่ไฮเปอร์ลิงก์ทั้งหมดจะถูกแยกออกมาในเอกสารใหม่คุณสามารถบันทึกได้ในภายหลัง

หมายเหตุ ที่อยู่ของไฮเปอร์ลิงก์แยกไม่อยู่ในลำดับเดิม


ลูกศรสีฟ้าฟองขวา คัดลอกไฮเปอร์ลิงก์ทั้งหมดหรือเฉพาะที่อยู่ไปยังคลิปบอร์ดด้วย Kutools for Word

หากคุณต้องการคัดลอกไฮเปอร์ลิงก์ทั้งหมดหรือเฉพาะที่อยู่ไปยังคลิปบอร์ดจากเอกสาร Word ได้อย่างง่ายดายและรวดเร็วไฟล์ คัดลอกไฮเปอร์ลิงก์ ประโยชน์ของ Kutools สำหรับ Word คุณสามารถทำสิ่งนี้ได้

Kutools สำหรับ Word, ที่มีมากกว่า  ฟังก์ชั่นที่มีประโยชน์ทำให้งานของคุณง่ายขึ้น 

หลังจากการติดตั้ง Kutools for Word โปรดทำดังนี้:(ดาวน์โหลด Kutools for Word ฟรีทันที!)

1 คลิก Kutools พลัส > คัดลอกไฮเปอร์ลิงก์.
doc คัดลอกไฮเปอร์ลิงก์ 1

2. ในกล่องโต้ตอบ popping ให้เลือกหนึ่งตัวเลือกตามที่คุณต้องการ
doc คัดลอกไฮเปอร์ลิงก์ 2

ตอนนี้เลือกหนึ่งตำแหน่งที่คุณต้องการวางไฮเปอร์ลิงก์กด Ctrl + V เพื่อวาง

คัดลอกและวางไฮเปอร์ลิงก์
doc คัดลอกไฮเปอร์ลิงก์ 3
คัดลอกและวางที่อยู่ไฮเปอร์ลิงก์
doc คัดลอกไฮเปอร์ลิงก์ 4

เรียกดูแบบแท็บและแก้ไขเอกสาร Word / สมุดงาน Excel หลายรายการเช่น Firefox, Chrome, Internet Explore 10!

คุณอาจคุ้นเคยกับการดูหน้าเว็บหลายหน้าใน Firefox / Chrome / IE และสลับไปมาระหว่างหน้าเว็บเหล่านั้นโดยคลิกที่แท็บที่เกี่ยวข้อง ที่นี่ Office Tab สนับสนุนการประมวลผลที่คล้ายกันซึ่งช่วยให้คุณสามารถเรียกดูเอกสาร Word หรือสมุดงาน Excel หลายรายการในหน้าต่าง Word หรือหน้าต่าง Excel และสลับไปมาระหว่างกันได้อย่างง่ายดายโดยคลิกที่แท็บ
คลิกเพื่อทดลองใช้ Office Tab ฟรี!

เรียกดูเอกสารหลายคำในหน้าต่างเดียวเป็น Firefox

บทความญาติ:

สุดยอดเครื่องมือเพิ่มผลผลิตในสำนักงาน

Kutools สำหรับ Word - ยกระดับประสบการณ์คำศัพท์ของคุณด้วย Over 100 คุณสมบัติเด่น!

🤖 Kutools ผู้ช่วย AI: แปลงโฉมงานเขียนของคุณด้วย AI - สร้างเนื้อหา  /  เขียนข้อความใหม่  /  สรุปเอกสาร  /  สอบถามข้อมูล ขึ้นอยู่กับเอกสารทั้งหมดนี้ภายใน Word

📘 ความเชี่ยวชาญด้านเอกสาร: แยกหน้า  /  ผสานเอกสาร  /  ส่งออกตัวเลือกในรูปแบบต่างๆ (PDF/TXT/DOC/HTML...)  /  แบทช์แปลงเป็น PDF  /  ส่งออกเพจเป็นรูปภาพ  /  พิมพ์หลายไฟล์พร้อมกัน...

การแก้ไขเนื้อหา: ค้นหาแบทช์และแทนที่ ข้ามหลายไฟล์  /  ปรับขนาดรูปภาพทั้งหมด  /  ย้ายแถวและคอลัมน์ของตาราง  /  แปลงตารางเป็นข้อความ...

🧹 ทำความสะอาดได้อย่างง่ายดาย: หลบไป พื้นที่พิเศษ  /  แบ่งส่วน  /  ส่วนหัวทั้งหมด  /  กล่องข้อความ  /  เชื่อมโยงหลายมิติ  / หากต้องการดูเครื่องมือถอดเพิ่มเติม โปรดไปที่ของเรา ลบกลุ่ม...

ส่วนแทรกโฆษณา: แทรก ตัวคั่นหลักพัน  /  กล่องกาเครื่องหมาย  /  ปุ่มวิทยุ  /  คิวอาร์โค้ด  /  บาร์โค้ด  /  ตารางเส้นทแยงมุม  /  คำอธิบายสมการ  /  คำบรรยายภาพ  /  คำบรรยายตาราง  /  รูปภาพหลายภาพ  / ค้นพบเพิ่มเติมใน แทรกกลุ่ม...

🔍 การเลือกที่แม่นยำ: ระบุ หน้าที่เฉพาะเจาะจง  /  ตาราง  /  รูปร่าง  /  หัวเรื่องย่อหน้า  / เสริมการนำทางด้วย ข้อมูลเพิ่มเติม เลือกคุณสมบัติ...

การปรับปรุงดาว: นำทางอย่างรวดเร็วไปยังสถานที่ใด ๆ  /  แทรกข้อความซ้ำอัตโนมัติ  /  สลับระหว่างหน้าต่างเอกสารได้อย่างราบรื่น  /  11 เครื่องมือการแปลง...

???? ต้องการลองใช้คุณสมบัติเหล่านี้หรือไม่? Kutools for Word มีไฟล์ ทดลองใช้ฟรี 60 วันโดยไม่มีข้อจำกัด! 🚀
 
Comments (16)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Good information! It assisted me in extracting links from an html file I had opened in Word. Refer to <a href="https://cookieclicker2.io">cookie clicker</a> is idea new.
This comment was minimized by the moderator on the site
How can we export word file hyperlinks and it's Text display to an excel file ? 
This comment was minimized by the moderator on the site
Impresionante! Millón de gracias.Me has acercado a la solución muchísimo pero si fuera posible copiarlos en la fila 1 de un excel ya creado sería impresionante. Es para aplicarles una formula que separa los links del texto.Un saludo y un millón de gracias!!!

This comment was minimized by the moderator on the site
Thank you so much! This was exactly what I was looking for!
This comment was minimized by the moderator on the site
I am amazed. That's gold. You saved me a ton of work.
This comment was minimized by the moderator on the site
Height of Legendary, thanks a million
This comment was minimized by the moderator on the site
Can I get the same script to run in outlook?
This comment was minimized by the moderator on the site
This is great stuff! Many thanks. What changes do I need to make to GetAllHyperlinks() for the following case? -- original document contains both normal text and links -- result wanted: same document but each link is followed by a space and the URL Thanks
This comment was minimized by the moderator on the site
Excellent! It helped me extract some links from an html file that I opened with Word (Excel was discarding some links). Here is the modified code so that a csv file could be built that could be further used. [quote]SubGetAllHyperlinks() ' Updateby20160504 ' https://www.extendoffice.com/documents/word/1411-word-select-copy-all-hyperlinks.html+&cd=1&hl=en&ct=clnk&gl=us<br /> Dim docCurrent As Document Dim docNew As Document Dim oLink As Hyperlink Dim rng As Range Application.ScreenUpdating = False Set docCurrent = ActiveDocument Set docNew = Documents.Add For Each oLink In docCurrent.Hyperlinks Set rng = docNew.Range rng.InsertAfter (oLink.TextToDisplay) rng.InsertAfter (", ") rng.InsertAfter (oLink.Address) rng.InsertAfter (vbCrLf) Next docNew.Activate Application.ScreenUpdating = True Application.ScreenRefresh End Sub[/quote]
This comment was minimized by the moderator on the site
This code works fine to me. The two on examples in the article description don't. Thanks a lot and my best regards.
This comment was minimized by the moderator on the site
Thank you very much for this script. This helped me to extract 5K links. Thank you very much.
This comment was minimized by the moderator on the site
Thank you. Just what I needed to parse a document.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations