top of page

Tonight's tip is on a macro that can be used in Microsoft Word to collect all sentences which contain a given phrase.

As you can see in this example there are references in a brief to produced documents containing the letter prefix, 'GAI'. We enter the below macro by pressing ALT + F11 and then right clicking on the name of the file in the project list and choosing Insert . . . Module.

Edit the macro by putting the term you want to search for on the line reading: .Text = "GAI" ' the word I am looking for

The only other change you need to make is to set the file path on the line beginning, "Set objSheet = appExcel.workbooks.Open" to an Excel file that you have created in a destination folder.

The results are written to the Excel file.

Option Explicit Sub FindWordCopySentence() Dim appExcel As Object Dim objSheet As Object Dim aRange As Range Dim intRowCount As Integer intRowCount = 1 Set aRange = ActiveDocument.Range With aRange.Find Do .Text = "GAI" ' the word I am looking for .Execute If .Found Then aRange.Expand Unit:=wdSentence aRange.Copy aRange.Collapse wdCollapseEnd If objSheet Is Nothing Then Set appExcel = CreateObject("Excel.Application") 'Change the file path to match the location of your test.xls Set objSheet = appExcel.workbooks.Open("C:\wordmacro\list.xlsx").Sheets("Sheet1") intRowCount = 1 End If objSheet.Cells(intRowCount, 1).Select objSheet.Paste intRowCount = intRowCount + 1 End If Loop While .Found End With If Not objSheet Is Nothing Then appExcel.workbooks(1).Close True appExcel.Quit Set objSheet = Nothing Set appExcel = Nothing End If Set aRange = Nothing End Sub

Thanks to Lucas for posting this macro here: http://www.vbaexpress.com/kb/getarticle.php?kb_id=553


 
 

Bloomberg BNA [Bureau of National Affairs] has introduced a great new legal analytics site that can give you instant graphic profiles of the business of law firms; the legal affairs of business; and the decision history of federal judges.

Create an account for Bloomberg Law and visit the site here.

A interactive profile for a federal judge can easily be generated with:

1. Pie charts breaking down his or her history on granting or dismissing motions to dismiss or summary judgments, and being overturned on appeal in different case types that you designate.

2. Line graphs showing the average length of cases in different legal areas.

3. Bar graphs listing which kinds of cases, which law firms, and which companies come to the judge's court most often.

Company profiles can be customized to show litigation in particular date ranges, litigation areas, and jurisdictions - and further broken down to show only cases where the company was represented by one or more firms that you select.

Similarly law firm profiles can be created for specified date ranges, jurisdiction, and case types - as well as being limited to specific clients.


 
 

You can insert field codes in Word by going to Insert . . . Quick Parts . . . and selecting Field. You can use some of these fields to enter simple metadata values. For example you can enter the current date with the DATE field. Field codes are revealed by pressing ALT + F9 in Word. In this example we can see that the date of the document is visible when field codes are toggled off:

. . . when we press ALT + F9 the field codes are revealed:

Field codes can be helpful when you're working on a brief that will later be edited so it can be filed by different plaintiffs. In the example above we have inserted ASK and REF fields. The ASK field is set up to prompt the user to enter a name for the plaintiff. The REF field plugs in the answer. So if we go to Insert . . . Quick Parts . . . Field and select ASK in the list to the left, we can enter a question in the prompt box and assign it a bookmark name - in this example plaintiff1.

Where we want the answer to the ASK question to appear we insert a REF field and assign it the plaintiff1 bookmark.

If a user clicks in the ASK field and presses F9 she or he will be prompted to submit an answer:

Toggling off the field codes will show that the REF field is then updated. If you want to update all of the instances to the plaintiffs name with the REF field, with the field codes toggled on, copy the REF. Then in find and replace for the existing plaintiff name, replace with the clipboard contents or ^c .


 
 

Sean O'Shea has more than 20 years of experience in the litigation support field with major law firms in New York and San Francisco.   He is an ACEDS Certified eDiscovery Specialist and a Relativity Certified Administrator.

The views expressed in this blog are those of the owner and do not reflect the views or opinions of the owner’s employer.

If you have a question or comment about this blog, please make a submission using the form to the right. 

Your details were sent successfully!

© 2015 by Sean O'Shea . Proudly created with Wix.com

bottom of page