Rmacros - John Miyamoto's R Macro List, 1/12/02 HOW TO...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 John Miyamoto's R Macro List, 1/12/02 HOW TO CIRCUMVENT MICROSOFT WORD SECURITY SYSTEMS THAT BLOCK THE USE OF THE R MACROS IN R.DO T Sometimes Word will not let you use the macros stored in R.DOT because the security settings on Word forbid the use of macros that originate with other users. If this happens, there is a solution. You can create your own R.DOT template as follows. * Open Rmacros.txt in Word. * Use File Open - Files of Type Template to open your own NORMAL.DOT. Save this file to the name, R.DOT, and then close this file. You may have to destroy (overwrite) the R.DOT file that I have provided to you - if you don't want to do this, store a copy of the original R.DOT file somewhere before overwriting with the new R.DOT that is based on your NORMAL.DOT. * I assume you are now working on your new version of R.DOT. Access the macros dialog from the menus by choosing Tools Macro /Macros. In the macros dialog, set Macros In: to R.DOT. Set the Macro Name: to Dummy. Then click on the Create button. * At this point, you should see: * Sub dummy() dummy Macro Macro created <date> by <name> End Sub * Delete the dummy macro, i.e., everything from "Sub dummy()" to "End Sub". * Leaving the Visual Basic macro editor open, switch to the window containing Rmacros.txt, and copy to thc clipboard all of the Visual Basic code for the R macros. * Switch back to the Visual Basic macro editor, and paste all of the Visual Basic code into the macro editor. * Choose File Save R from the menu for the macro editor, and then close the macro editor. * Finally close R.DOT template. You now have a R.DOT template whose macros ought to be runnable on your computer. To use these macros: * Create a new blank document (File New). * From the menus, choose Tools Templates and Add-Ins. * In the Document Template field, click on the Attach button, and then search for R.DOT. Select R.DOT, and click to Open this template (you should now see it in Document Templates field of the Templates and Add-Ins). Then click on OK. * The R macros should now be available when you use the current file. Try running the RS macro. It should insert the #Section and #EndSection boundaries into your document. *************************************************************** *** Visual Basic Code for R Word Macros Start Below this Line *** *************************************************************** Sub RL() Macro RL copies the current line to the clipboard, transfers control to R, and runs the clipboard contents in R. It uses a kluge, inserting a "#<carriage return>" at the beginning of the set of lines that are copied to the clipboard. This
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sheet1 Page 2 kluge avoids a strange problem that sometimes arises on some, but not all computer systems where a "1" is automatically inserted as the first symbol in the set of lines that are copied to the clipboard. With ActiveDocument.Bookmarks
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/12/2010 for the course APPLIED ST 2010 taught by Professor Various during the Spring '10 term at Universidad Nacional Agraria La Molina.

Page1 / 12

Rmacros - John Miyamoto's R Macro List, 1/12/02 HOW TO...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online