General Instructions to Search Pubmed for Potential Reviewer Cois Using a Macro

Total Page:16

File Type:pdf, Size:1020Kb

General Instructions to Search Pubmed for Potential Reviewer Cois Using a Macro

INSTALLING AND RUNNING THE QVR COI MACRO (Revised 5/24/13) General Description: How to use a Microsoft (MS) Word macro to convert a list of key personnel into a statement that can be used to conduct a person search in QVR.  To use this macro the key personnel names must be set up in one column as follows: Last Name(s), First Name, other name information (initial, degree, suffix etc.), if any.

This document describes the following processes (click on the relevant link to go directly to that section):  Using MS Excel list of key personnel and copying it into MS Word  Running the macro within MS Word  Installing the QVRCOI macro for use in MS Word

Using a MS Excel key personnel list and copying it into MS Word The MS Excel list of key personnel and/or institution names must be in the correct format before copying it into MS Word. See sample shown below  A header row is required (any text can be listed-first row just has to be present)  The key personnel names should be organized in one column using the following format: Last Name(s), First Name, other name information (initial, degree, suffix etc.)  For Example: Smith, John L., PhD, MD

Copy to a Word document 1. Highlight and Copy the MS Excel column containing the key personnel names 2. Paste into a new blank Word document and then, after the tabled results appear, use the mini-clipboard option (connected to the last row) to Keep Text Only (as shown below)

3. The resulting text should appear similar as the text displayed below.

1 Running the macro within MS Word  Do not highlight or sort the table data prior to running the macro.  These instructions assume that the macro is installed and the command is placed on the Quick Access Toolbar. If the macro is not installed, review the installation instructions below. If the macro is installed, but there is no button established, the following instructions can be used to create one: R:\SRP-DEAS- SHARED\Tools and Technical Guides\Office2010-CustomizeQuickAccessToolbar.doc

1. Click the preset Quick Access Toolbar Button (after copying and pasting the Excel column as shown above) 2. The key personnel table will be transformed into a paragraph format that can be used to conduct a person search in QVR. An example is shown below.

Installing the QVRCOI macro within MS Word 1. Replace the main Word template to set the Arial 11 default font and install the SRP macros (PubMed, Delete Hard Returns/ParaSign and QVR COI, Person ID and Expertise) by: a. Closing the MS Word program b. Copying the Normal.dotm file from the following location: R:\SRP-DEAS-SHARED\Tools and Technical Guides\Word-PubMed+ParaSign+QVR Macros c. Then pasting the Normal.dotm listed above into the following folder to replace the original version (substitute the applicable NIH login name where specified) i. Windows XP: C:\Documents and Settings\ NIHLogInName \Application Data\Microsoft\Templates ii. Windows 7: C:\Users\ NIHLogInName \AppData\Roaming\Microsoft\Templates Note: If the ‘Application Data’ or ’App Data’ folder is not visible, the following folder option needs to be set. Windows XP Location: Tools Menu\Folder Options\View tab Windows 7 Location: Organize\Folder and Search Options\View tab

1. The macros will now be available in the following MS Word program locations: a. Customize Quick Access Toolbar > ‘Choose commands from: Macros’ window

2 b. And the View > Macros > Macros window shown below

Installing the macro(s) within MS Word 1. Open MS Word 2. Highlight the text in Appendix A and copy it (Edit  Copy or Ctrl+C) 3. Click on View > Macros button as shown below

4. When the ‘Macros’ window (shown in the instructions above) appears, type in ‘QVRCOIMacro’ in the Macro name: field, select “All Active templates and documents’ from the Macros in: field and click Create 5. When the Visual Basic window appear, paste the text between the ‘Sub QVRCOIMacro()’ line and the ‘End Sub’ line

6. Select File and then ‘Close and Return to Microsoft Word’ 7. The macros will now be available in the following MS Word program locations: a. Customize Quick Access Toolbar > ‘Choose commands from: Macros’ window

3 b. And the View > Macros > Macros window shown below

Appendix A: QVRCOI Macro Code

Sub QVRCOIMacro() Selection.WholeStory Selection.ConvertToTable Separator:=wdSeparateByCommas, NumColumns:=6, AutoFitBehavior:=wdAutoFitContent With Selection.Tables(1) .Style = "Table Grid" .ApplyStyleHeadingRows = True .ApplyStyleLastRow = True .ApplyStyleFirstColumn = True .ApplyStyleLastColumn = True End With

ActiveDocument.Tables(1).Columns(3).Delete ActiveDocument.Tables(1).Columns(4).Delete ActiveDocument.Tables(1).Columns(3).Delete ActiveDocument.Tables(1).Columns(3).Delete

ActiveDocument.Tables(1).Rows(1).Select Selection.Rows.Delete

ActiveDocument.Tables(1).Select Selection.Sort ExcludeHeader:=False, FieldNumber:="Column 1", SortFieldType:=wdSortFieldAlphanumeric, SortOrder:=wdSortOrderAscending

ActiveDocument.Tables(1).Columns(1).Select 4 For Each c In Selection.Cells c.Range = c.Range & "," Next

ActiveDocument.Tables(1).Columns(2).Select For Each c In Selection.Cells c.Range = c.Range & "/" Next

Selection.Rows.ConvertToText Separator:=wdSeparateByTabs, NestedTables:=True Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "^t" .Replacement.Text = " " .Forward = True .Wrap = wdFindContinue End With Selection.Find.Execute Replace:=wdReplaceAll

With Selection.Find .Text = "^p" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue End With Selection.Find.Execute Replace:=wdReplaceAll

With Selection.Find .Text = "/^p" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue End With Selection.Find.Execute Replace:=wdReplaceAll

Selection.Font.Name = "Arial" Selection.Font.Size = 11 Selection.Font.Bold = False End Sub

5

Recommended publications