Word Add-ins Part 3: Search for Text Strings in Documents and Add Comments (Harry Miller)

Published 10 September 08 02:49 PM

You can search the text in any open Microsoft Office Word document for specific strings if you put the code in an application-level add-in. When you find an instance of the string, you can perform some action on it. This video shows how to flag the string with a comment that contains text passed in from a calling method.

The code comes from the forum thread that's linked below, under "Related resources." You could just look at it there, but then you'd miss the whole "why did he get knocked in the head last time" thing. Oh, the title is different in the video because no one would search the Web for "to hunt lives the add-in" to answer this question, but I think it's a much more dramatic title for a video about an add-in that searches for stuff, after you've already found the video.

Related resources:

Forum: Look for a string and comment it - how?

How to: Search for Text in Documents

How to: Set Search Options in Word

Find Object (Word 2007 Reference)

Duration: 3 minutes, 39 seconds

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# car insurance » Word Add-ins Part 3: Search for Text Strings in Documents and Add Comments (Harry Miller) said on September 10, 2008 5:54 PM:

PingBack from http://hoursfunnywallpaper.cn/?p=5575

# shim said on May 26, 2009 1:29 AM:

Hi,

Very cute and helpful video..

I just wanted to ask on how to get the highlighted text in a  document..

thanks

# shim said on May 26, 2009 1:53 AM:

Hi,

I already got the answer..by the help of your video

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required

About VSTO Team

This login represents the Visual Studio Tools for Office team. Many members of the team us this account for publishing technical blog posts.

This Blog

Syndication

Page view tracker