Loncat ke daftar isi utama

Bagaimana cara memilih dan menyalin semua hyperlink dari dokumen Word?

Dalam beberapa kasus, Anda memiliki dokumen panjang dengan beberapa hyperlink yang ada, dan Anda hanya perlu menyalin semua hyperlink sekaligus dari dokumen ini lalu menempelkannya ke yang lain. Adakah cara bisa dengan cepat menyalin semuanya sekaligus daripada menyalinnya satu per satu?

Salin semua hyperlink dengan VBA

Ekstrak semua alamat hyperlink dengan VBA

Salin semua hyperlink atau hanya alamat ke clipboard dengan Kutools for Wordide bagus3


panah gelembung kanan biru Salin semua hyperlink dengan VBA

1. Buka dokumen Word yang ingin Anda salin hyperlinknya, dan tekan Alt + F11 untuk membuka Jendela Aplikasi Berbasis Microsoft Visual.

2. klik Menyisipkan > Modul, dan salin VBA berikut ke Window.

VBA: Salin semua hyperlink

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. Klik Run tombol untuk menjalankan kode VBA. Kemudian semua hyperlink disalin ke dokumen baru. Anda dapat menyimpan dokumen baru nanti. Anda bisa melihat hasilnya sebagai berikut.

Catatan: VBA ini hanya bisa berjalan ketika semua hyperlink ditautkan dengan word, jika ada gambar dengan hyperlink, kode VBA ini tidak bisa berfungsi.


panah gelembung kanan biru Ekstrak semua alamat hyperlink dengan VBA

1. Buka dokumen Word yang ingin Anda ekstrak hyperlinknya, dan tekan Alt + F11 untuk membuka Jendela Aplikasi Berbasis Microsoft Visual.

2. klik Menyisipkan > Modul, dan salin VBA berikut ke Window.

VBA: Ekstrak semua alamat hyperlink

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. Klik Run tombol untuk menjalankan kode VBA. Kemudian semua alamat hyperlink diekstraksi dalam dokumen baru, Anda dapat menyimpannya nanti.

Catatan: Alamat ekstrak hyperlink tidak dalam urutan aslinya.


panah gelembung kanan biru Salin semua hyperlink atau hanya alamat ke clipboard dengan Kutools for Word

Jika Anda ingin menyalin semua hyperlink atau hanya alamat ke clipboard dari dokumen Word dengan mudah dan cepat, file Salin Hyperlink kegunaan Kutools for Word dapat membantu Anda ini.

Kutools for Word, dengan lebih dari  fungsi praktis, membuat pekerjaan Anda lebih mudah. 

Setelah menginstal Kutools for Word, lakukan seperti di bawah ini:(Unduh Gratis Kutools untuk Word Sekarang!)

1. klik Kutools Ditambah > Salin Hyperlink.
doc copy hyperlink 1

2. Pada dialog popping, pilih salah satu opsi yang Anda butuhkan.
doc copy hyperlink 2

Sekarang, pilih satu lokasi yang Anda inginkan untuk menempatkan hyperlink, tekan Ctrl + V untuk menempelkannya.

Salin dan tempel hyperlink
doc copy hyperlink 3
Salin dan tempel alamat hyperlink
doc copy hyperlink 4

Menjelajah dengan tab & mengedit beberapa dokumen Word / buku kerja Excel sebagai Firefox, Chrome, Internet Explore 10!

Anda mungkin tidak asing lagi untuk melihat beberapa halaman web di Firefox / Chrome / IE, dan beralih di antaranya dengan mengklik tab yang sesuai dengan mudah. Di sini, Office Tab mendukung pemrosesan serupa, yang memungkinkan Anda menelusuri beberapa dokumen Word atau buku kerja Excel dalam satu jendela Word atau jendela Excel, dan dengan mudah beralih di antara keduanya dengan mengklik tabnya.
Klik untuk uji coba gratis Office Tab!

Jelajahi beberapa dokumen kata dalam satu jendela sebagai Firefox

Artikel Relatif:

Alat Produktivitas Kantor Terbaik

Kutools for Word - Tingkatkan Pengalaman Kata Anda dengan Over 100 Fitur Luar Biasa!

🤖 Asisten AI Kutools: Ubah tulisan Anda dengan AI - Hasilkan Konten  /  Menulis Ulang Teks  /  Meringkas Dokumen  /  Menanyakan Informasi berdasarkan Dokumen, semuanya dalam Word

📘 Penguasaan Dokumen: Halaman Terpisah  /  Gabungkan Dokumen  /  Ekspor Pilihan dalam Berbagai Format (PDF/TXT/DOC/HTML...)  /  Konversi Batch ke PDF  /  Ekspor Halaman sebagai Gambar  /  Cetak Banyak File sekaligus...

Pengeditan Isi: Temukan dan Ganti Batch di Banyak File  /  Ubah Ukuran Semua Gambar  /  Ubah Urutan Baris dan Kolom Tabel  /  Ubah Tabel menjadi Teks...

🧹 Bersih dengan Mudah: Menyapu Spasi Ekstra  /  Bagian Istirahat  /  Semua Header  /  Teks box  /  Hyperlink  / Untuk alat penghapus lainnya, kunjungi kami Hapus Grup...

Sisipan Kreatif: Memasukkan Seribu Pemisah  /  Kotak Centang  /  Tombol Radio  /  Kode QR  /  barcode  /  Tabel Garis Diagonal  /  Keterangan Persamaan  /  Keterangan gambar  /  Keterangan Tabel  /  Banyak Gambar  / Temukan lebih lanjut di Sisipkan Grup...

🔍 Pilihan Presisi: Tepat halaman tertentu  /  tabel  /  bentuk  /  paragraf judul  / Tingkatkan navigasi dengan lebih Pilih fitur...

Peningkatan Bintang: Navigasi dengan cepat ke lokasi mana pun  /  menyisipkan teks berulang secara otomatis  /  beralih antar jendela dokumen dengan mulus  /  11 Alat Konversi...

👉 Ingin mencoba fitur-fitur tersebut? Kutools for Word menawarkan a Uji coba gratis 60-hari, tanpa batasan! 🚀
 
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