- Dec 15, 2020 Go to the Home tab and select Find, or press Ctrl + F. In older versions of Microsoft Word, select File File Search. In the Navigation pane, enter the text you want to search for. A list of matching words displays in the Navigation pane and instances of the word are highlighted in the main document.
- Create a new document and edit it with others at the same time — from your computer, phone or tablet. Free with a Google account.
- My program needs to search for a word in a text file, and if it finds that word, to print out/display the entire line. Example: employee name date joined position project annual salary tom jones 1/13/2011 accountant pricing 55000 Susan lee 2/5/2007 Manager policy 70000 User enters a search word: accountant. Program searches text for accountant.
For line1 in open(file1): with open(line1+'.txt', 'a') as myfile: for line2 in open(file2): line2split = line2.split(' ') if 'word' in line2: if 'word 2' in line2: for part in line2: linepart = line2.split: #AttributeError: 'list' object has no attribute 'split' if 'color=' in linepart: print(linepart). Dec 31, 2020 In Microsoft Word, older versions featured the Edit menu, and the Find option is found in that menu. Newer versions of Word feature a Ribbon, and the Find option is found on the Home tab, at the far right side. In the find pane on the left side of the window, search the document for text.
- Search options:

Displaying the Search/Find Window Pane
When a PDF is opened in the Acrobat Reader (not in a browser), the search window pane may or may not be displayed. To display the search/find window pane, use 'Ctrl+F'.
When the Find window opens, follow these steps and refer to Figure 1 below:
- Click the small arrow on the right side of the box.
- Select the drop down item - 'Open Full Acrobat Search'.
Figure 1
Search Options
There are several ways to search for information within a PDF document. These include the following:
- Basic Search
- Advanced Search
Basic Search Options
To execute a basic search request complete the following steps:

- Type your search term(s) inside the 'text box' where you are asked: 'What word or phrase would you like to search for?'
- Click the 'Search' button to execute the search request.
Advanced Search Options
To get to the Advanced Search feature, click on 'Show More Options' at the bottom of the search window pane.

Brief explanation of the options available in the advanced search are:
- Match Exact Word Or Phrase - Searches for the entire string of characters, including spaces, in the same order in which they appear in the text box.
- Match Any Of The Words - Searches for any instances of at least one of the words typed. For example, if you search for each of, the results include any instances in which one or both of the two words appear: each, of, each of, or of each.
- Match All Of The Words - Searches for instances that contain all your search words, but not necessarily in the order you type them. Available only for a search of multiple PDFs or index definition files.
- Boolean Query - Uses the Boolean operators that you type with the search words into the What Word Or Phrase Would You Like To Search For box. Available only for searching multiple PDFs or PDF indexes.
Note: You cannot run wildcard searches using asterisks (*) or question marks (?) when searching PDF indexes.
Click 'Use Advanced Search Options' near the bottom of the search window pane to display the advanced search information. To execute an advanced search request complete the following steps:
- Type your search term(s) inside the 'text box' where you are asked:'What word or phrase would you like to search for?'
- Select an option from the drop down menu for 'Return results containing:'
- Click the 'Search' button to execute the search request.
Sample Search Request Using Advanced Search Options
For the purposes of this example, steps are provided to illustrate how to execute a search request for finding information about diazinon and kaolin in a PDF document. Assume that a PDF document is opened in the browser. If the search window pane is not displayed, please refer back to 'Displaying the Search Window Pane' for assistance.
The Search Criteria
Below are the steps to be followed for completing a search request to find information about diazinon and kaolin. Refer to Figure 2.
- Click 'Show More Options' near the bottom of the search window pane. (Step 1)
- Select 'Match Any Of The Words' from the drop down menu for 'Return results containing:' (Step 2)
- Type 'diazinon kaolin' inside the 'text box' where you are asked: What word or phrase would you like to search for?' (Step 3)
- Click the 'Search' button to execute the search request. (Step 3)
Figure 2
How To Find A Word In A Document On Mac
The Search Results
In this example, the search results produced 10 items in the PDF document for information about diazinon and kaolin. See Figure 3 below.

Figure 3
Additional Information
Setting a Preference for Displaying the Advanced Search Option as the Default
How To Find A Word In A Document On Macbook
- Select 'Edit' from the menu option at the top-left of the computer screen.
- Select 'Preferences'.
- The Preferences popup window is displayed.
- Under Categories: select 'Search'.
- Refer to the 'Search' section and check the box 'Always show more options in advanced search'.
- Click the 'Ok' button to save.
This topic shows how to use the classes in the Open XML SDK 2.5 forOffice to programmatically search and replace a text value in a wordprocessing document.
The following assembly directives are required to compile the code inthis topic.
Packages and Document Parts
An Open XML document is stored as a package, whose format is defined byISO/IEC 29500-2. Thepackage can have multiple parts with relationships between them. Therelationship between parts controls the category of the document. Adocument can be defined as a word-processing document if itspackage-relationship item contains a relationship to a main documentpart. Wacom drivers for mac os. If its package-relationship item contains a relationship to apresentation part it can be defined as a presentation document. If itspackage-relationship item contains a relationship to a workbook part, itis defined as a spreadsheet document. In this how-to topic, you will usea word-processing document package.
Getting a WordprocessingDocument Object
In the sample code, you start by opening the word processing file byinstantiating the WordprocessingDocument class as shown inthe following using statement. In the samestatement, you open the word processing file document by using theOpen method, with the Boolean parameter setto true to enable editing the document.
The using statement provides a recommendedalternative to the typical .Open, .Save, .Close sequence. It ensuresthat the Dispose method (internal methodused by the Open XML SDK to clean up resources) is automatically calledwhen the closing brace is reached. The block that follows the using statement establishes a scope for theobject that is created or named in the using statement, in this case wordDoc. Becausethe WordprocessingDocument class in theOpen XML SDK automatically saves and closes the object as part of itsSystem.IDisposable implementation, andbecause Dispose is automatically calledwhen you exit the block, you do not have to explicitly call Save and Close─aslong as you use using.
How the Sample Code Works
After you have opened the file for editing, you read it by using a StreamReader object.
The code then creates a regular expression object that contains thestring 'Hello world!' It then replaces the text value with the text 'HiEveryone!.' For more information about regular expressions, see RegularExpressions
Sample Code
The following example demonstrates a quick and easy way to search andreplace. It may not be reliable because it retrieves the XML document instring format. Depending on the regular expression you mightunintentionally replace XML tags and corrupt the document. If you simplywant to search a document, but not replace the contents you can useMainDocumentPart.Document.InnerText.
This example also shows how to use a regular expression to search andreplace the text value, 'Hello world!' stored in a word processing filenamed 'MyPkg8.docx,' with the value 'Hi Everyone!'. To call the methodSearchAndReplace, you can use the followingexample.
After running the program, you can inspect the file to see the change inthe text, 'Hello world!'
The following is the complete sample code in both C# and Visual Basic.
See also
