Sub Vision_Batch1() ' PasteToVision_Correspondence Macro Version 1.0 ' Macro created 09/01/2001 by Simon Child simon.child@gpuk.net ' © Simon Child 09/01/2001 ' Latest version will be found at www.GPUK.net ' You may use this macro free of charge in your practice, and you may modify it to suit your needs, so long as you retain this copyright notice and you do not distribute it to other practices. ' If you wish to pass on copies to colleagues please do not do so! Please refer them to www.GPUK.net where they can obtain the latest version and in return www.GPUK.net may gain a little heightened awareness of its services. ' Please email any improvements and modifications to simon.child@gpuk.net ' This macro is configured for Word 97 to paste scanned and tidied text to the correspondence section of InPractice Vision ' It will also work for pasting text to other parts of Vision such as History if that is where you prefer to paste letters. ' It will also work for other clinical systems if you appropriately amend the pasting part of the macro to suit the target in your system ' It will also work under Word 2000 if you enable the Microsoft Forms 2.0 Object library in Word 2000 ' WORD 2000 instructions: ' Start Word 2000 and go to Tools/Macro/Visual Basic Editor. ' In VB Editor go to Project-Normal (which is Word normal.dot) Tools/References ' Select (enable) "Microsoft Forms 2.0 Object library" ' If you can't find it then browse to locate fm20.dll and add that - this is the Microsoft Forms 2.0 Object library - you may have to tick it after adding it. ' Actually there are 7 macros here, the only differences between them are the batch numbers on the first 6, and the last one not using batches ' The idea is that for each macro you can place a button on the Word toolbar, labelled Batch 1, Batch 2, etc ' These are then used according to which batch you are processing, and correspondingly the macro puts almost all of the path to the saved image file at the bottom of the ocr'd and pasted letter. ' You need only add the digit of the page number of the batch. ' If you do this correctly you will then be able to simply copy/paste CTRL-C/CTRL-V the full file path into the Start-Run box and this will start up Windows imaging to display the file for you in just a second or two. ' The directory structure to use to store image files which complements this macro is described in the accompanying report scanreport.rtf to be found at www.GPUK.net ' TO INSTALL THIS MACRO FILE INTO WORD 97 (similar in Word 2000): ' Open Word, Select Tools/Macro/Macros ' Type any name, e.g. a single letter, and click Create Macro ' This will open an editing box for you with a new macro of the name that you just typed ' Delete all the text (about four lines) between (and including) Sub yourmacroname () and End sub ' Leave the cursor at the very bottom and go to Insert/File and insert this file. Save and exit ' TO ADD BUTTONS TO THE WORD 97 TOOLBAR (Word 2000 probably similar) ' On a blank area of the toolbar right click, select Customize/Commands/Macros ' Find the first macro and drag it to the toolbar. Confusingly you should not drag it to a blank area but use an active area amongst or just next to some other buttons. ' Shorten the name to e.g Batch 1 - Rt click/Name and edit it. ' Repeat for other batch buttons ' DIRECTORY STRUCTURE WHICH WORKS WITH THIS MACRO ' Create an empty directory structure in the form: ' Year-Month-Day number-Batch number ' i.e. 2001 contains twelve months, each of which contains 31 days, each of which contains 6 batch folders numbered one to 6. ' So the path to June 9th batch 1 would be F:\scans\2001\June\9\Batch 01\ ' If your scans are saved on a different drive letter/directory you will have to edit the macros accordingly ' After scanning a batch of letters in Omnipage 10 do File/Save Images and save them all as individual files to the appropriate Year/Month/Day/Batch directory, giving a filename of today's date and batch e.g. 09-06-01-01. These are automatically suffixed by Omnipage as Page 1.tif, Page 2.tif, etc ' More details in the report available at www.GPUK.net On Error GoTo noselectError Selection.Find.ClearFormatting ' Replace tabs by spaces - Vision cannot accept tabs Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "^t" .Replacement.Text = " " .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute replace:=wdReplaceAll ' Replace high ascii apostrophes with ascii apostrophes - Vision cannot accept high ascii characters Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = Chr(180) .Replacement.Text = "'" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute replace:=wdReplaceAll ' Copy the letter to clipboard, then to DataObject LetterText, then make a string "Contents" containing the letter preceded by \\ and ended by two linefeeds ' The \\ is to filter out identifiable data from the GPRD data collection Dim LetterText As New DataObject Dim Contents Selection.Copy LetterText.GetFromClipboard Contents = "\\ " + LetterText.GetText(1) + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' Get the date, format it and store it with batch and filename info in "Message" Dim Date1, Date2, Message Date1 = Format(Date, "mmm d yyyy") Date2 = Format(Date, "dd-mm-yy") sYear = Format(Date, "yyyy") sMonth = Format(Date, "mmmm") sDay = Format(Date, "dd") ' A choice of messages: ' Message = "This letter has been scanned but the image file has not been saved" + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' To make a macro for batch 2, change the 1 and 01 in the next line to 2 and 02 ' Message = "Letter image stored in Batch 1, " + Date1 + ", Filename " + Date2 + "-01.tif" + Chr(13) + Chr(10) + Chr(13) + Chr(10) Message = "Image file in " + Chr(34) + "F:\Scans\" + sYear + "\" + sMonth + "\Day " + sDay + "\Batch 01\" + Date2 +"-01 Page" + ".tif" + Chr(34) + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' Combine the two strings into one DataObject and put it on the clipboard Dim PasteString As New DataObject PasteString.SetText (Contents) + (Message) PasteString.PutInClipboard On Error GoTo appnotopenError ' change to Correspondence Add ' (If your destination window has a different name then put the title of appropriate window between the inverted commas) AppActivate "Clinical Correspondence - Add" ' Paste clipboard contents to Vision/Notepad, and exit ' Note that this sends keys to move the cursor to the correct position and to set the apporopriate options in this dialog box ' To use this with Vision Correspondence box, just open the dialog box and leave the cursor where it ends up. If you move the cursor from its default positin then the pasting will fail. ' To use with some other system, or with Vision History you will need to edit the next line SendKeys "{UP 4}{TAB 11} {TAB 3}^V{TAB 3}{ENTER}" Exit Sub noselectError: MsgBox "You have not selected any text to copy to Vision." Exit Sub Resume appnotopenError: MsgBox "You have not opened the correct correspondence box in the patient's Vision record ready to receive the text of this letter." + Chr(13) + Chr(10) + Chr(13) + Chr(10) + "Make sure that Vision is running, that the correct patient is selected, and that the Clinical Correspondence - Add box has been opened." Exit Sub Resume End Sub Sub Vision_Batch2() ' PasteToVision_Correspondence Macro Version 1.0 ' Macro created 09/01/2001 by Simon Child simon.child@gpuk.net ' © Simon Child 09/01/2001 ' Latest version will be found at www.GPUK.net ' You may use this macro free of charge in your practice, and you may modify it to suit your needs, so long as you retain this copyright notice and you do not distribute it to other practices. ' If you wish to pass on copies to colleagues please do not do so! Please refer them to www.GPUK.net where they can obtain the latest version and in return www.GPUK.net may gain a little heightened awareness of its services. ' Please email any improvements and modifications to simon.child@gpuk.net ' This macro is configured for Word 97 to paste scanned and tidied text to the correspondence section of InPractice Vision ' It will also work for pasting text to other parts of Vision such as History if that is where you prefer to paste letters. ' It will also work for other clinical systems if you appropriately amend the pasting part of the macro to suit the target in your system ' It will also work under Word 2000 if you enable the Microsoft Forms 2.0 Object library in Word 2000 ' WORD 2000 instructions: ' Start Word 2000 and go to Tools/Macro/Visual Basic Editor. ' In VB Editor go to Project-Normal (which is Word normal.dot) Tools/References ' Select (enable) "Microsoft Forms 2.0 Object library" ' If you can't find it then browse to locate fm20.dll and add that - this is the Microsoft Forms 2.0 Object library - you may have to tick it after adding it. ' Actually there are 7 macros here, the only differences between them are the batch numbers on the first 6, and the last one not using batches ' The idea is that for each macro you can place a button on the Word toolbar, labelled Batch 1, Batch 2, etc ' These are then used according to which batch you are processing, and correspondingly the macro puts almost all of the path to the saved image file at the bottom of the ocr'd and pasted letter. ' You need only add the digit of the page number of the batch. ' If you do this correctly you will then be able to simply copy/paste CTRL-C/CTRL-V the full file path into the Start-Run box and this will start up Windows imaging to display the file for you in just a second or two. ' The directory structure to use to store image files which complements this macro is described in the accompanying report scanreport.rtf to be found at www.GPUK.net ' TO INSTALL THIS MACRO FILE INTO WORD 97 (similar in Word 2000): ' Open Word, Select Tools/Macro/Macros ' Type any name, e.g. a single letter, and click Create Macro ' This will open an editing box for you with a new macro of the name that you just typed ' Delete all the text (about four lines) between (and including) Sub yourmacroname () and End sub ' Leave the cursor at the very bottom and go to Insert/File and insert this file. Save and exit ' TO ADD BUTTONS TO THE WORD 97 TOOLBAR (Word 2000 probably similar) ' On a blank area of the toolbar right click, select Customize/Commands/Macros ' Find the first macro and drag it to the toolbar. Confusingly you should not drag it to a blank area but use an active area amongst or just next to some other buttons. ' Shorten the name to e.g Batch 1 - Rt click/Name and edit it. ' Repeat for other batch buttons ' DIRECTORY STRUCTURE WHICH WORKS WITH THIS MACRO ' Create an empty directory structure in the form: ' Year-Month-Day number-Batch number ' i.e. 2001 contains twelve months, each of which contains 31 days, each of which contains 6 batch folders numbered one to 6. ' So the path to June 9th batch 1 would be F:\scans\2001\June\9\Batch 01\ ' If your scans are saved on a different drive letter/directory you will have to edit the macros accordingly ' After scanning a batch of letters in Omnipage 10 do File/Save Images and save them all as individual files to the appropriate Year/Month/Day/Batch directory, giving a filename of today's date and batch e.g. 09-06-01-01. These are automatically suffixed by Omnipage as Page 1.tif, Page 2.tif, etc ' More details in the report available at www.GPUK.net On Error GoTo noselectError Selection.Find.ClearFormatting ' Replace tabs by spaces - Vision cannot accept tabs Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "^t" .Replacement.Text = " " .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute replace:=wdReplaceAll ' Replace high ascii apostrophes with ascii apostrophes - Vision cannot accept high ascii characters Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = Chr(180) .Replacement.Text = "'" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute replace:=wdReplaceAll ' Copy the letter to clipboard, then to DataObject LetterText, then make a string "Contents" containing the letter preceded by \\ and ended by two linefeeds ' The \\ is to filter out identifiable data from the GPRD data collection Dim LetterText As New DataObject Dim Contents Selection.Copy LetterText.GetFromClipboard Contents = "\\ " + LetterText.GetText(1) + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' Get the date, format it and store it with batch and filename info in "Message" Dim Date1, Date2, Message Date1 = Format(Date, "mmm d yyyy") Date2 = Format(Date, "dd-mm-yy") sYear = Format(Date, "yyyy") sMonth = Format(Date, "mmmm") sDay = Format(Date, "dd") ' A choice of messages: ' Message = "This letter has been scanned but the image file has not been saved" + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' To make a macro for batch 2, change the 1 and 01 in the next line to 2 and 02 ' Message = "Letter image stored in Batch 1, " + Date1 + ", Filename " + Date2 + "-01.tif" + Chr(13) + Chr(10) + Chr(13) + Chr(10) Message = "Image file in " + Chr(34) + "F:\Scans\" + sYear + "\" + sMonth + "\Day " + sDay + "\Batch 02\" + Date2 +"-02 Page" + ".tif" + Chr(34) + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' Combine the two strings into one DataObject and put it on the clipboard Dim PasteString As New DataObject PasteString.SetText (Contents) + (Message) PasteString.PutInClipboard On Error GoTo appnotopenError ' change to Correspondence Add ' (If your destination window has a different name then put the title of appropriate window between the inverted commas) AppActivate "Clinical Correspondence - Add" ' Paste clipboard contents to Vision/Notepad, and exit ' Note that this sends keys to move the cursor to the correct position and to set the apporopriate options in this dialog box ' To use this with Vision Correspondence box, just open the dialog box and leave the cursor where it ends up. If you move the cursor from its default positin then the pasting will fail. ' To use with some other system, or with Vision History you will need to edit the next line SendKeys "{UP 4}{TAB 11} {TAB 3}^V{TAB 3}{ENTER}" Exit Sub noselectError: MsgBox "You have not selected any text to copy to Vision." Exit Sub Resume appnotopenError: MsgBox "You have not opened the correct correspondence box in the patient's Vision record ready to receive the text of this letter." + Chr(13) + Chr(10) + Chr(13) + Chr(10) + "Make sure that Vision is running, that the correct patient is selected, and that the Clinical Correspondence - Add box has been opened." Exit Sub Resume End Sub Sub Vision_Batch3() ' PasteToVision_Correspondence Macro Version 1.0 ' Macro created 09/01/2001 by Simon Child simon.child@gpuk.net ' © Simon Child 09/01/2001 ' Latest version will be found at www.GPUK.net ' You may use this macro free of charge in your practice, and you may modify it to suit your needs, so long as you retain this copyright notice and you do not distribute it to other practices. ' If you wish to pass on copies to colleagues please do not do so! Please refer them to www.GPUK.net where they can obtain the latest version and in return www.GPUK.net may gain a little heightened awareness of its services. ' Please email any improvements and modifications to simon.child@gpuk.net ' This macro is configured for Word 97 to paste scanned and tidied text to the correspondence section of InPractice Vision ' It will also work for pasting text to other parts of Vision such as History if that is where you prefer to paste letters. ' It will also work for other clinical systems if you appropriately amend the pasting part of the macro to suit the target in your system ' It will also work under Word 2000 if you enable the Microsoft Forms 2.0 Object library in Word 2000 ' WORD 2000 instructions: ' Start Word 2000 and go to Tools/Macro/Visual Basic Editor. ' In VB Editor go to Project-Normal (which is Word normal.dot) Tools/References ' Select (enable) "Microsoft Forms 2.0 Object library" ' If you can't find it then browse to locate fm20.dll and add that - this is the Microsoft Forms 2.0 Object library - you may have to tick it after adding it. ' Actually there are 7 macros here, the only differences between them are the batch numbers on the first 6, and the last one not using batches ' The idea is that for each macro you can place a button on the Word toolbar, labelled Batch 1, Batch 2, etc ' These are then used according to which batch you are processing, and correspondingly the macro puts almost all of the path to the saved image file at the bottom of the ocr'd and pasted letter. ' You need only add the digit of the page number of the batch. ' If you do this correctly you will then be able to simply copy/paste CTRL-C/CTRL-V the full file path into the Start-Run box and this will start up Windows imaging to display the file for you in just a second or two. ' The directory structure to use to store image files which complements this macro is described in the accompanying report scanreport.rtf to be found at www.GPUK.net ' TO INSTALL THIS MACRO FILE INTO WORD 97 (similar in Word 2000): ' Open Word, Select Tools/Macro/Macros ' Type any name, e.g. a single letter, and click Create Macro ' This will open an editing box for you with a new macro of the name that you just typed ' Delete all the text (about four lines) between (and including) Sub yourmacroname () and End sub ' Leave the cursor at the very bottom and go to Insert/File and insert this file. Save and exit ' TO ADD BUTTONS TO THE WORD 97 TOOLBAR (Word 2000 probably similar) ' On a blank area of the toolbar right click, select Customize/Commands/Macros ' Find the first macro and drag it to the toolbar. Confusingly you should not drag it to a blank area but use an active area amongst or just next to some other buttons. ' Shorten the name to e.g Batch 1 - Rt click/Name and edit it. ' Repeat for other batch buttons ' DIRECTORY STRUCTURE WHICH WORKS WITH THIS MACRO ' Create an empty directory structure in the form: ' Year-Month-Day number-Batch number ' i.e. 2001 contains twelve months, each of which contains 31 days, each of which contains 6 batch folders numbered one to 6. ' So the path to June 9th batch 1 would be F:\scans\2001\June\9\Batch 01\ ' If your scans are saved on a different drive letter/directory you will have to edit the macros accordingly ' After scanning a batch of letters in Omnipage 10 do File/Save Images and save them all as individual files to the appropriate Year/Month/Day/Batch directory, giving a filename of today's date and batch e.g. 09-06-01-01. These are automatically suffixed by Omnipage as Page 1.tif, Page 2.tif, etc ' More details in the report available at www.GPUK.net On Error GoTo noselectError Selection.Find.ClearFormatting ' Replace tabs by spaces - Vision cannot accept tabs Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "^t" .Replacement.Text = " " .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute replace:=wdReplaceAll ' Replace high ascii apostrophes with ascii apostrophes - Vision cannot accept high ascii characters Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = Chr(180) .Replacement.Text = "'" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute replace:=wdReplaceAll ' Copy the letter to clipboard, then to DataObject LetterText, then make a string "Contents" containing the letter preceded by \\ and ended by two linefeeds ' The \\ is to filter out identifiable data from the GPRD data collection Dim LetterText As New DataObject Dim Contents Selection.Copy LetterText.GetFromClipboard Contents = "\\ " + LetterText.GetText(1) + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' Get the date, format it and store it with batch and filename info in "Message" Dim Date1, Date2, Message Date1 = Format(Date, "mmm d yyyy") Date2 = Format(Date, "dd-mm-yy") sYear = Format(Date, "yyyy") sMonth = Format(Date, "mmmm") sDay = Format(Date, "dd") ' A choice of messages: ' Message = "This letter has been scanned but the image file has not been saved" + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' To make a macro for batch 2, change the 1 and 01 in the next line to 2 and 02 ' Message = "Letter image stored in Batch 1, " + Date1 + ", Filename " + Date2 + "-01.tif" + Chr(13) + Chr(10) + Chr(13) + Chr(10) Message = "Image file in " + Chr(34) + "F:\Scans\" + sYear + "\" + sMonth + "\Day " + sDay + "\Batch 03\" + Date2 +"-03 Page" + ".tif" + Chr(34) + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' Combine the two strings into one DataObject and put it on the clipboard Dim PasteString As New DataObject PasteString.SetText (Contents) + (Message) PasteString.PutInClipboard On Error GoTo appnotopenError ' change to Correspondence Add ' (If your destination window has a different name then put the title of appropriate window between the inverted commas) AppActivate "Clinical Correspondence - Add" ' Paste clipboard contents to Vision/Notepad, and exit ' Note that this sends keys to move the cursor to the correct position and to set the apporopriate options in this dialog box ' To use this with Vision Correspondence box, just open the dialog box and leave the cursor where it ends up. If you move the cursor from its default positin then the pasting will fail. ' To use with some other system, or with Vision History you will need to edit the next line SendKeys "{UP 4}{TAB 11} {TAB 3}^V{TAB 3}{ENTER}" Exit Sub noselectError: MsgBox "You have not selected any text to copy to Vision." Exit Sub Resume appnotopenError: MsgBox "You have not opened the correct correspondence box in the patient's Vision record ready to receive the text of this letter." + Chr(13) + Chr(10) + Chr(13) + Chr(10) + "Make sure that Vision is running, that the correct patient is selected, and that the Clinical Correspondence - Add box has been opened." Exit Sub Resume End Sub Sub Vision_Batch4() ' PasteToVision_Correspondence Macro Version 1.0 ' Macro created 09/01/2001 by Simon Child simon.child@gpuk.net ' © Simon Child 09/01/2001 ' Latest version will be found at www.GPUK.net ' You may use this macro free of charge in your practice, and you may modify it to suit your needs, so long as you retain this copyright notice and you do not distribute it to other practices. ' If you wish to pass on copies to colleagues please do not do so! Please refer them to www.GPUK.net where they can obtain the latest version and in return www.GPUK.net may gain a little heightened awareness of its services. ' Please email any improvements and modifications to simon.child@gpuk.net ' This macro is configured for Word 97 to paste scanned and tidied text to the correspondence section of InPractice Vision ' It will also work for pasting text to other parts of Vision such as History if that is where you prefer to paste letters. ' It will also work for other clinical systems if you appropriately amend the pasting part of the macro to suit the target in your system ' It will also work under Word 2000 if you enable the Microsoft Forms 2.0 Object library in Word 2000 ' WORD 2000 instructions: ' Start Word 2000 and go to Tools/Macro/Visual Basic Editor. ' In VB Editor go to Project-Normal (which is Word normal.dot) Tools/References ' Select (enable) "Microsoft Forms 2.0 Object library" ' If you can't find it then browse to locate fm20.dll and add that - this is the Microsoft Forms 2.0 Object library - you may have to tick it after adding it. ' Actually there are 7 macros here, the only differences between them are the batch numbers on the first 6, and the last one not using batches ' The idea is that for each macro you can place a button on the Word toolbar, labelled Batch 1, Batch 2, etc ' These are then used according to which batch you are processing, and correspondingly the macro puts almost all of the path to the saved image file at the bottom of the ocr'd and pasted letter. ' You need only add the digit of the page number of the batch. ' If you do this correctly you will then be able to simply copy/paste CTRL-C/CTRL-V the full file path into the Start-Run box and this will start up Windows imaging to display the file for you in just a second or two. ' The directory structure to use to store image files which complements this macro is described in the accompanying report scanreport.rtf to be found at www.GPUK.net ' DIRECTORY STRUCTURE WHICH WORKS WITH THIS MACRO ' Create an empty directory structure in the form: ' Year-Month-Day number-Batch number ' i.e. 2001 contains twelve months, each of which contains 31 days, each of which contains 6 batch folders numbered one to 6. ' So the path to June 9th batch 1 would be F:\scans\2001\June\9\Batch 01\ ' If your scans are saved on a different drive letter/directory you will have to edit the macros accordingly ' After scanning a batch of letters in Omnipage 10 do File/Save Images and save them all as individual files to the appropriate Year/Month/Day/Batch directory, giving a filename of today's date and batch e.g. 09-06-01-01. These are automatically suffixed by Omnipage as Page 1.tif, Page 2.tif, etc ' More details in the report available at www.GPUK.net ' TO INSTALL THIS MACRO FILE INTO WORD 97 (similar in Word 2000): ' Open Word, Select Tools/Macro/Macros ' Type any name, e.g. a single letter, and click Create Macro ' This will open an editing box for you with a new macro of the name that you just typed ' Delete all the text (about four lines) between (and including) Sub yourmacroname () and End sub ' Leave the cursor at the very bottom and go to Insert/File and insert this file. Save and exit ' TO ADD BUTTONS TO THE WORD 97 TOOLBAR (Word 2000 probably similar) ' On a blank area of the toolbar right click, select Customize/Commands/Macros ' Find the first macro and drag it to the toolbar. Confusingly you should not drag it to a blank area but use an active area amongst or just next to some other buttons. ' Shorten the name to e.g Batch 1 - Rt click/Name and edit it. ' Repeat for other batch buttons On Error GoTo noselectError Selection.Find.ClearFormatting ' Replace tabs by spaces - Vision cannot accept tabs Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "^t" .Replacement.Text = " " .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute replace:=wdReplaceAll ' Replace high ascii apostrophes with ascii apostrophes - Vision cannot accept high ascii characters Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = Chr(180) .Replacement.Text = "'" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute replace:=wdReplaceAll ' Copy the letter to clipboard, then to DataObject LetterText, then make a string "Contents" containing the letter preceded by \\ and ended by two linefeeds ' The \\ is to filter out identifiable data from the GPRD data collection Dim LetterText As New DataObject Dim Contents Selection.Copy LetterText.GetFromClipboard Contents = "\\ " + LetterText.GetText(1) + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' Get the date, format it and store it with batch and filename info in "Message" Dim Date1, Date2, Message Date1 = Format(Date, "mmm d yyyy") Date2 = Format(Date, "dd-mm-yy") sYear = Format(Date, "yyyy") sMonth = Format(Date, "mmmm") sDay = Format(Date, "dd") ' A choice of messages: ' Message = "This letter has been scanned but the image file has not been saved" + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' To make a macro for batch 2, change the 1 and 01 in the next line to 2 and 02 ' Message = "Letter image stored in Batch 1, " + Date1 + ", Filename " + Date2 + "-01.tif" + Chr(13) + Chr(10) + Chr(13) + Chr(10) Message = "Image file in " + Chr(34) + "F:\Scans\" + sYear + "\" + sMonth + "\Day " + sDay + "\Batch 04\" + Date2 +"-04 Page" + ".tif" + Chr(34) + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' Combine the two strings into one DataObject and put it on the clipboard Dim PasteString As New DataObject PasteString.SetText (Contents) + (Message) PasteString.PutInClipboard On Error GoTo appnotopenError ' change to Correspondence Add ' (If your destination window has a different name then put the title of appropriate window between the inverted commas) AppActivate "Clinical Correspondence - Add" ' Paste clipboard contents to Vision/Notepad, and exit ' Note that this sends keys to move the cursor to the correct position and to set the apporopriate options in this dialog box ' To use this with Vision Correspondence box, just open the dialog box and leave the cursor where it ends up. If you move the cursor from its default positin then the pasting will fail. ' To use with some other system, or with Vision History you will need to edit the next line SendKeys "{UP 4}{TAB 11} {TAB 3}^V{TAB 3}{ENTER}" Exit Sub noselectError: MsgBox "You have not selected any text to copy to Vision." Exit Sub Resume appnotopenError: MsgBox "You have not opened the correct correspondence box in the patient's Vision record ready to receive the text of this letter." + Chr(13) + Chr(10) + Chr(13) + Chr(10) + "Make sure that Vision is running, that the correct patient is selected, and that the Clinical Correspondence - Add box has been opened." Exit Sub Resume End Sub Sub Vision_Batch5() ' PasteToVision_Correspondence Macro Version 1.0 ' Macro created 09/01/2001 by Simon Child simon.child@gpuk.net ' © Simon Child 09/01/2001 ' Latest version will be found at www.GPUK.net ' You may use this macro free of charge in your practice, and you may modify it to suit your needs, so long as you retain this copyright notice and you do not distribute it to other practices. ' If you wish to pass on copies to colleagues please do not do so! Please refer them to www.GPUK.net where they can obtain the latest version and in return www.GPUK.net may gain a little heightened awareness of its services. ' Please email any improvements and modifications to simon.child@gpuk.net ' This macro is configured for Word 97 to paste scanned and tidied text to the correspondence section of InPractice Vision ' It will also work for pasting text to other parts of Vision such as History if that is where you prefer to paste letters. ' It will also work for other clinical systems if you appropriately amend the pasting part of the macro to suit the target in your system ' It will also work under Word 2000 if you enable the Microsoft Forms 2.0 Object library in Word 2000 ' WORD 2000 instructions: ' Start Word 2000 and go to Tools/Macro/Visual Basic Editor. ' In VB Editor go to Project-Normal (which is Word normal.dot) Tools/References ' Select (enable) "Microsoft Forms 2.0 Object library" ' If you can't find it then browse to locate fm20.dll and add that - this is the Microsoft Forms 2.0 Object library - you may have to tick it after adding it. ' Actually there are 7 macros here, the only differences between them are the batch numbers on the first 6, and the last one not using batches ' The idea is that for each macro you can place a button on the Word toolbar, labelled Batch 1, Batch 2, etc ' These are then used according to which batch you are processing, and correspondingly the macro puts almost all of the path to the saved image file at the bottom of the ocr'd and pasted letter. ' You need only add the digit of the page number of the batch. ' If you do this correctly you will then be able to simply copy/paste CTRL-C/CTRL-V the full file path into the Start-Run box and this will start up Windows imaging to display the file for you in just a second or two. ' The directory structure to use to store image files which complements this macro is described in the accompanying report scanreport.rtf to be found at www.GPUK.net ' TO INSTALL THIS MACRO FILE INTO WORD 97 (similar in Word 2000): ' Open Word, Select Tools/Macro/Macros ' Type any name, e.g. a single letter, and click Create Macro ' This will open an editing box for you with a new macro of the name that you just typed ' Delete all the text (about four lines) between (and including) Sub yourmacroname () and End sub ' Leave the cursor at the very bottom and go to Insert/File and insert this file. Save and exit ' TO ADD BUTTONS TO THE WORD 97 TOOLBAR (Word 2000 probably similar) ' On a blank area of the toolbar right click, select Customize/Commands/Macros ' Find the first macro and drag it to the toolbar. Confusingly you should not drag it to a blank area but use an active area amongst or just next to some other buttons. ' Shorten the name to e.g Batch 1 - Rt click/Name and edit it. ' Repeat for other batch buttons ' DIRECTORY STRUCTURE WHICH WORKS WITH THIS MACRO ' Create an empty directory structure in the form: ' Year-Month-Day number-Batch number ' i.e. 2001 contains twelve months, each of which contains 31 days, each of which contains 6 batch folders numbered one to 6. ' So the path to June 9th batch 1 would be F:\scans\2001\June\9\Batch 01\ ' If your scans are saved on a different drive letter/directory you will have to edit the macros accordingly ' After scanning a batch of letters in Omnipage 10 do File/Save Images and save them all as individual files to the appropriate Year/Month/Day/Batch directory, giving a filename of today's date and batch e.g. 09-06-01-01. These are automatically suffixed by Omnipage as Page 1.tif, Page 2.tif, etc ' More details in the report available at www.GPUK.net On Error GoTo noselectError Selection.Find.ClearFormatting ' Replace tabs by spaces - Vision cannot accept tabs Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "^t" .Replacement.Text = " " .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute replace:=wdReplaceAll ' Replace high ascii apostrophes with ascii apostrophes - Vision cannot accept high ascii characters Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = Chr(180) .Replacement.Text = "'" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute replace:=wdReplaceAll ' Copy the letter to clipboard, then to DataObject LetterText, then make a string "Contents" containing the letter preceded by \\ and ended by two linefeeds ' The \\ is to filter out identifiable data from the GPRD data collection Dim LetterText As New DataObject Dim Contents Selection.Copy LetterText.GetFromClipboard Contents = "\\ " + LetterText.GetText(1) + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' Get the date, format it and store it with batch and filename info in "Message" Dim Date1, Date2, Message Date1 = Format(Date, "mmm d yyyy") Date2 = Format(Date, "dd-mm-yy") sYear = Format(Date, "yyyy") sMonth = Format(Date, "mmmm") sDay = Format(Date, "dd") ' A choice of messages: ' Message = "This letter has been scanned but the image file has not been saved" + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' To make a macro for batch 2, change the 1 and 01 in the next line to 2 and 02 ' Message = "Letter image stored in Batch 1, " + Date1 + ", Filename " + Date2 + "-01.tif" + Chr(13) + Chr(10) + Chr(13) + Chr(10) Message = "Image file in " + Chr(34) + "F:\Scans\" + sYear + "\" + sMonth + "\Day " + sDay + "\Batch 05\" + Date2 +"-05 Page" + ".tif" + Chr(34) + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' Combine the two strings into one DataObject and put it on the clipboard Dim PasteString As New DataObject PasteString.SetText (Contents) + (Message) PasteString.PutInClipboard On Error GoTo appnotopenError ' change to Correspondence Add ' (If your destination window has a different name then put the title of appropriate window between the inverted commas) AppActivate "Clinical Correspondence - Add" ' Paste clipboard contents to Vision/Notepad, and exit ' Note that this sends keys to move the cursor to the correct position and to set the apporopriate options in this dialog box ' To use this with Vision Correspondence box, just open the dialog box and leave the cursor where it ends up. If you move the cursor from its default positin then the pasting will fail. ' To use with some other system, or with Vision History you will need to edit the next line SendKeys "{UP 4}{TAB 11} {TAB 3}^V{TAB 3}{ENTER}" Exit Sub noselectError: MsgBox "You have not selected any text to copy to Vision." Exit Sub Resume appnotopenError: MsgBox "You have not opened the correct correspondence box in the patient's Vision record ready to receive the text of this letter." + Chr(13) + Chr(10) + Chr(13) + Chr(10) + "Make sure that Vision is running, that the correct patient is selected, and that the Clinical Correspondence - Add box has been opened." Exit Sub Resume End Sub Sub Vision_Batch6() ' PasteToVision_Correspondence Macro Version 1.0 ' Macro created 09/01/2001 by Simon Child simon.child@gpuk.net ' © Simon Child 09/01/2001 ' Latest version will be found at www.GPUK.net ' You may use this macro free of charge in your practice, and you may modify it to suit your needs, so long as you retain this copyright notice and you do not distribute it to other practices. ' If you wish to pass on copies to colleagues please do not do so! Please refer them to www.GPUK.net where they can obtain the latest version and in return www.GPUK.net may gain a little heightened awareness of its services. ' Please email any improvements and modifications to simon.child@gpuk.net ' This macro is configured for Word 97 to paste scanned and tidied text to the correspondence section of InPractice Vision ' It will also work for pasting text to other parts of Vision such as History if that is where you prefer to paste letters. ' It will also work for other clinical systems if you appropriately amend the pasting part of the macro to suit the target in your system ' It will also work under Word 2000 if you enable the Microsoft Forms 2.0 Object library in Word 2000 ' WORD 2000 instructions: ' Start Word 2000 and go to Tools/Macro/Visual Basic Editor. ' In VB Editor go to Project-Normal (which is Word normal.dot) Tools/References ' Select (enable) "Microsoft Forms 2.0 Object library" ' If you can't find it then browse to locate fm20.dll and add that - this is the Microsoft Forms 2.0 Object library - you may have to tick it after adding it. ' Actually there are 7 macros here, the only differences between them are the batch numbers on the first 6, and the last one not using batches ' The idea is that for each macro you can place a button on the Word toolbar, labelled Batch 1, Batch 2, etc ' These are then used according to which batch you are processing, and correspondingly the macro puts almost all of the path to the saved image file at the bottom of the ocr'd and pasted letter. ' You need only add the digit of the page number of the batch. ' If you do this correctly you will then be able to simply copy/paste CTRL-C/CTRL-V the full file path into the Start-Run box and this will start up Windows imaging to display the file for you in just a second or two. ' The directory structure to use to store image files which complements this macro is described in the accompanying report scanreport.rtf to be found at www.GPUK.net ' TO INSTALL THIS MACRO FILE INTO WORD 97 (similar in Word 2000): ' Open Word, Select Tools/Macro/Macros ' Type any name, e.g. a single letter, and click Create Macro ' This will open an editing box for you with a new macro of the name that you just typed ' Delete all the text (about four lines) between (and including) Sub yourmacroname () and End sub ' Leave the cursor at the very bottom and go to Insert/File and insert this file. Save and exit ' TO ADD BUTTONS TO THE WORD 97 TOOLBAR (Word 2000 probably similar) ' On a blank area of the toolbar right click, select Customize/Commands/Macros ' Find the first macro and drag it to the toolbar. Confusingly you should not drag it to a blank area but use an active area amongst or just next to some other buttons. ' Shorten the name to e.g Batch 1 - Rt click/Name and edit it. ' Repeat for other batch buttons ' DIRECTORY STRUCTURE WHICH WORKS WITH THIS MACRO ' Create an empty directory structure in the form: ' Year-Month-Day number-Batch number ' i.e. 2001 contains twelve months, each of which contains 31 days, each of which contains 6 batch folders numbered one to 6. ' So the path to June 9th batch 1 would be F:\scans\2001\June\9\Batch 01\ ' If your scans are saved on a different drive letter/directory you will have to edit the macros accordingly ' After scanning a batch of letters in Omnipage 10 do File/Save Images and save them all as individual files to the appropriate Year/Month/Day/Batch directory, giving a filename of today's date and batch e.g. 09-06-01-01. These are automatically suffixed by Omnipage as Page 1.tif, Page 2.tif, etc ' More details in the report available at www.GPUK.net On Error GoTo noselectError Selection.Find.ClearFormatting ' Replace tabs by spaces - Vision cannot accept tabs Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "^t" .Replacement.Text = " " .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute replace:=wdReplaceAll ' Replace high ascii apostrophes with ascii apostrophes - Vision cannot accept high ascii characters Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = Chr(180) .Replacement.Text = "'" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute replace:=wdReplaceAll ' Copy the letter to clipboard, then to DataObject LetterText, then make a string "Contents" containing the letter preceded by \\ and ended by two linefeeds ' The \\ is to filter out identifiable data from the GPRD data collection Dim LetterText As New DataObject Dim Contents Selection.Copy LetterText.GetFromClipboard Contents = "\\ " + LetterText.GetText(1) + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' Get the date, format it and store it with batch and filename info in "Message" Dim Date1, Date2, Message Date1 = Format(Date, "mmm d yyyy") Date2 = Format(Date, "dd-mm-yy") sYear = Format(Date, "yyyy") sMonth = Format(Date, "mmmm") sDay = Format(Date, "dd") ' A choice of messages: ' Message = "This letter has been scanned but the image file has not been saved" + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' To make a macro for batch 2, change the 1 and 01 in the next line to 2 and 02 ' Message = "Letter image stored in Batch 1, " + Date1 + ", Filename " + Date2 + "-01.tif" + Chr(13) + Chr(10) + Chr(13) + Chr(10) Message = "Image file in " + Chr(34) + "F:\Scans\" + sYear + "\" + sMonth + "\Day " + sDay + "\Batch 06\" + Date2 +"-06 Page" + ".tif" + Chr(34) + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' Combine the two strings into one DataObject and put it on the clipboard Dim PasteString As New DataObject PasteString.SetText (Contents) + (Message) PasteString.PutInClipboard On Error GoTo appnotopenError ' change to Correspondence Add ' (If your destination window has a different name then put the title of appropriate window between the inverted commas) AppActivate "Clinical Correspondence - Add" ' Paste clipboard contents to Vision/Notepad, and exit ' Note that this sends keys to move the cursor to the correct position and to set the apporopriate options in this dialog box ' To use this with Vision Correspondence box, just open the dialog box and leave the cursor where it ends up. If you move the cursor from its default positin then the pasting will fail. ' To use with some other system, or with Vision History you will need to edit the next line SendKeys "{UP 4}{TAB 11} {TAB 3}^V{TAB 3}{ENTER}" Exit Sub noselectError: MsgBox "You have not selected any text to copy to Vision." Exit Sub Resume appnotopenError: MsgBox "You have not opened the correct correspondence box in the patient's Vision record ready to receive the text of this letter." + Chr(13) + Chr(10) + Chr(13) + Chr(10) + "Make sure that Vision is running, that the correct patient is selected, and that the Clinical Correspondence - Add box has been opened." Exit Sub Resume End Sub Sub Vision_Paste() ' PasteToVision_Correspondence Macro Version 1.0 ' Macro created 09/01/2001 by Simon Child simon.child@gpuk.net ' © Simon Child 09/01/2001 ' Latest version will be found at www.GPUK.net ' You may use this macro free of charge in your practice, and you may modify it to suit your needs, so long as you retain this copyright notice and you do not distribute it to other practices. ' If you wish to pass on copies to colleagues please do not do so! Please refer them to www.GPUK.net where they can obtain the latest version and in return www.GPUK.net may gain a little heightened awareness of its services. ' Please email any improvements and modifications to simon.child@gpuk.net ' This macro is configured for Word 97 to paste scanned and tidied text to the correspondence section of InPractice Vision ' It will also work for pasting text to other parts of Vision such as History if that is where you prefer to paste letters. ' It will also work for other clinical systems if you appropriately amend the pasting part of the macro to suit the target in your system ' It will also work under Word 2000 if you enable the Microsoft Forms 2.0 Object library in Word 2000 ' WORD 2000 instructions: ' Start Word 2000 and go to Tools/Macro/Visual Basic Editor. ' In VB Editor go to Project-Normal (which is Word normal.dot) Tools/References ' Select (enable) "Microsoft Forms 2.0 Object library" ' If you can't find it then browse to locate fm20.dll and add that - this is the Microsoft Forms 2.0 Object library - you may have to tick it after adding it. ' Actually there are 7 macros here, the only differences between them are the batch numbers on the first 6, and the last one not using batches ' The idea is that for each macro you can place a button on the Word toolbar, labelled Batch 1, Batch 2, etc ' These are then used according to which batch you are processing, and correspondingly the macro puts almost all of the path to the saved image file at the bottom of the ocr'd and pasted letter. ' You need only add the digit of the page number of the batch. ' If you do this correctly you will then be able to simply copy/paste CTRL-C/CTRL-V the full file path into the Start-Run box and this will start up Windows imaging to display the file for you in just a second or two. ' The directory structure to use to store image files which complements this macro is described in the accompanying report scanreport.rtf to be found at www.GPUK.net ' TO INSTALL THIS MACRO FILE INTO WORD 97 (similar in Word 2000): ' Open Word, Select Tools/Macro/Macros ' Type any name, e.g. a single letter, and click Create Macro ' This will open an editing box for you with a new macro of the name that you just typed ' Delete all the text (about four lines) between (and including) Sub yourmacroname () and End sub ' Leave the cursor at the very bottom and go to Insert/File and insert this file. Save and exit ' TO ADD BUTTONS TO THE WORD 97 TOOLBAR (Word 2000 probably similar) ' On a blank area of the toolbar right click, select Customize/Commands/Macros ' Find the first macro and drag it to the toolbar. Confusingly you should not drag it to a blank area but use an active area amongst or just next to some other buttons. ' Shorten the name to e.g Batch 1 - Rt click/Name and edit it. ' Repeat for other batch buttons ' DIRECTORY STRUCTURE WHICH WORKS WITH THIS MACRO ' Create an empty directory structure in the form: ' Year-Month-Day number-Batch number ' i.e. 2001 contains twelve months, each of which contains 31 days, each of which contains 6 batch folders numbered one to 6. ' So the path to June 9th batch 1 would be F:\scans\2001\June\9\Batch 01\ ' If your scans are saved on a different drive letter/directory you will have to edit the macros accordingly ' After scanning a batch of letters in Omnipage 10 do File/Save Images and save them all as individual files to the appropriate Year/Month/Day/Batch directory, giving a filename of today's date and batch e.g. 09-06-01-01. These are automatically suffixed by Omnipage as Page 1.tif, Page 2.tif, etc ' More details in the report available at www.GPUK.net On Error GoTo noselectError Selection.Find.ClearFormatting ' Replace tabs by spaces - Vision cannot accept tabs Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "^t" .Replacement.Text = " " .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute replace:=wdReplaceAll ' Replace high ascii apostrophes with ascii apostrophes - Vision cannot accept high ascii characters Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = Chr(180) .Replacement.Text = "'" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute replace:=wdReplaceAll ' Copy the letter to clipboard, then to DataObject LetterText, then make a string "Contents" containing the letter preceded by \\ and ended by two linefeeds ' The \\ is to filter out identifiable data from the GPRD data collection Dim LetterText As New DataObject Dim Contents Selection.Copy LetterText.GetFromClipboard Contents = "\\ " + LetterText.GetText(1) + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' Get the date, format it and store it with batch and filename info in "Message" Dim Date1, Date2, Message Date1 = Format(Date, "mmm d yyyy") Date2 = Format(Date, "dd-mm-yy") sYear = Format(Date, "yyyy") sMonth = Format(Date, "mmmm") sDay = Format(Date, "dd") ' A choice of messages: Message = "This letter has been scanned but the image file has not been saved" + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' To make a macro for batch 2, change the 1 and 01 in the next line to 2 and 02 ' Message = "Letter image stored in Batch 1, " + Date1 + ", Filename " + Date2 + "-01.tif" + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' Message = "Image file in " + Chr(34) + "F:\Scans\" + sYear + "\" + sMonth + "\Day " + sDay + "\Batch 01\" + Date2 +"-01 Page" + ".tif" + Chr(34) + Chr(13) + Chr(10) + Chr(13) + Chr(10) ' Combine the two strings into one DataObject and put it on the clipboard Dim PasteString As New DataObject PasteString.SetText (Contents) + (Message) PasteString.PutInClipboard On Error GoTo appnotopenError ' change to Correspondence Add ' (If your destination window has a different name then put the title of appropriate window between the inverted commas) AppActivate "Clinical Correspondence - Add" ' Paste clipboard contents to Vision/Notepad, and exit ' Note that this sends keys to move the cursor to the correct position and to set the apporopriate options in this dialog box ' To use this with Vision Correspondence box, just open the dialog box and leave the cursor where it ends up. If you move the cursor from its default positin then the pasting will fail. ' To use with some other system, or with Vision History you will need to edit the next line SendKeys "{UP 4}{TAB 11} {TAB 3}^V{TAB 3}{ENTER}" Exit Sub noselectError: MsgBox "You have not selected any text to copy to Vision." Exit Sub Resume appnotopenError: MsgBox "You have not opened the correct correspondence box in the patient's Vision record ready to receive the text of this letter." + Chr(13) + Chr(10) + Chr(13) + Chr(10) + "Make sure that Vision is running, that the correct patient is selected, and that the Clinical Correspondence - Add box has been opened." Exit Sub Resume End Sub