Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-28-2018, 12:23 PM
d4okeefe d4okeefe is offline Extract List of terms and combine on a Table Windows 10 Extract List of terms and combine on a Table Office 2016
Advanced Beginner
 
Join Date: Apr 2013
Posts: 77
d4okeefe is on a distinguished road
Default


The sub that you pasted pretty much does what you want, right? It accounts for 2 documents, the first one that you search, and the second one the code creates, and that you paste to. If you want to search 2 existing documents, open them by their file locations rather than using ActiveDocument:

Code:
Sub open_docs()
    Dim doc_name1 As String
    Dim doc1 As Document
    doc_name1 = "c:\[location]\Doc1.docx"
    Set doc1 = Documents.Open(doc_name1)
    
    Dim doc_name2 As String
    Dim doc2 As Document
    doc_name1 = "c:\[location]\Doc2.docx"
    Set doc2 = Documents.Open(doc_name1)
End Sub
You can then access the range objects of both "doc1" and "doc2".

You can get a list of country names here, but I'm not sure why you would need it.
Reply With Quote
  #2  
Old 06-28-2018, 01:08 PM
XRope XRope is offline Extract List of terms and combine on a Table Windows 7 64bit Extract List of terms and combine on a Table Office 2010 32bit
Novice
Extract List of terms and combine on a Table
 
Join Date: Jun 2018
Posts: 17
XRope is on a distinguished road
Default

Hi d4okeefe,



thanks for replying. Yes i want 2 docs to be searched and results to be shown in a new doc with 2 columns for comparison.


The macro should be a "Search and Extract" for text in () and countries listed in both Doc 1 and Doc 2, thats why I need to integrate a list of countries into the macro but I dont know where and how.


Its important that entries sould be extracted and combined in order of appearance in both docs.


I hope it's clear.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract List of terms and combine on a Table Need macro to make list of "defined terms" glnz Word VBA 8 09-07-2022 02:09 PM
How to extract names from a list flyoverrunner Excel 3 06-06-2018 04:54 AM
Extract List of terms and combine on a Table Best Practice for Indexing Multiple Word Terms and Sub-Terms jhy001 Word 4 11-06-2017 02:08 PM
Extract List of terms and combine on a Table How to Combine a Table of Contents Page with Another Document Dante49 Word 2 10-24-2016 01:53 PM
Extract List of terms and combine on a Table Need to extract two word domains from a list (BULK) Maxwell314 Excel 3 12-08-2014 06:17 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:25 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft