Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 27th, 2012, 06:50 AM
Registered User
Join Date: Jan 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Code to Read a glossary in Excel and search Word documents and highlight the terms


I am fairly new at VBA so bare with my complete ignorance.

I have an Excel sheet containing a simple list of "chains" contain in sheet2 column A

I want to integrate a small form to open the msOpenDialog to open multiple word files and clicking OK launch the treatment.

The process:
For each file selected:
- Check the content for the "strings" contained in the Excel sheet
- if a string is found "highlight" it in the Word document
- Once all strings are checked in the document save amended Word Document as ORIGINAL_NAME_prepped.

The macro must work with Office 2003, 2007 and 2010

Thank you for your help.

Old January 29th, 2012, 12:04 PM
Friend of Wrox
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts


Instead of msOpenDialog can you try common dialog. You can store the path / files and then loop through the same.


You can use Find method to search for text (http://vbadud.blogspot.com/2012/01/h...ag-string.html)

C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)

Similar Threads
Thread Thread Starter Forum Replies Last Post
Generating MS Excel and MS Word documents through .Net 3.5 swatianand ASP.NET 3.5 Basics 1 January 20th, 2010 07:38 AM
Auto run batch file attached to word-Documents/VBA code is required angls Word VBA 3 September 23rd, 2009 06:08 PM
Licensing Terms of Source Code? dsharpie BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 7 March 7th, 2007 10:20 AM
Inserting Excel pivot chart into Word documents jfejsa Word VBA 1 January 23rd, 2006 09:16 PM
How to highlight search results in Word haiying Access VBA 0 July 25th, 2005 11:13 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.