Enhancing Developer Productivity with Office XP - Easy Reference: Desktop Images (Page 3 of 4 )
To make all of the information discussed thus far available for instant access, put it on your desktop. Paste screenshots of the database relationships and the to-do list (along with a model of the system being built or any other useful information) into a new document in your favourite image editor. Trim the canvas and export the result into a compressed file format (i.e., jpeg, gif, png, etc.) and use this file as the computer's desktop image.
Getting Field Names Into Excel Populate the Access database by entering the same string into each table field. (Be sure to use a string that isn't part of any field name.) In the database window, click once on a table to select it. Choose Export from the File menu. In the resulting dialogue box, select "XML documents" for document type, input a name and location for the new file, and click "Export". In the options box that results, unclick the "Schema of the data" checkbox and click the "OK" button.
Now open the XML file just created in Word. The field names will be displayed as XML tags:
Clear away the opening and closing tags. At the end of the remaining code, press the Tab key and highlight and copy the resulting tab "character", which seems to be the only way to get the tab into the "Find and Replace" dialogue box. Open that dialogue box and choose to replace the dummy string from the database with the tab. Then replace the greater-than and less-than tags with nothing (clear the tab from and leave clear the replace portion of the "Find and Replace" dialogue box. The result should look similar to the following:
Copy all the remaining text and paste it into an Excel workbook. Because Excel reads a tab (among other things) as a signal to put text after in a new cell, the text will displayed in separate columns:
Simply delete the second column and the filed names remain and are ready for use in the next (and much more fruitful) task of using Excel to generate code.
Using Excel to Generate Code Developers can use Excel's Series function to quickly generate repetitive code much faster than even repeatedly pasting the code in a text editor—and the field names will already be included.
Highlight the cells containing the field names and move them a few columns away from the edge of the worksheet so room in which to work on either side of the field names is available. Write the code that will go on either side of the code in one row, highlight the code on one side of the field names, and position the mouse pointer over the lower right of the group of cell so that the pointer changes to a crosshair. Drag the pointer over as many cells as should be filled with the code. Repeat for other sections that should be filled with code. The following example demonstrates a facsimile of the results, but text the field names are treated as variable names to demonstrate another use for the same operation:
Cleaning Up Excel-Generated Code with Word One operation that can easily be performed in this latest release of Word is changing the case of text, which may be necessary for some coding activities. For instance, suppose the text in column G above needed to have its initial letters capitalized or be in all capitals. Simply copy the text that must be altered into Word. Click the "Paste Options" icon at the bottom of the text and choose "Keep Text Only" to rid the Word document of any table structure data. Then highlight the text and choose "Change Case" from the Format menu to create initial caps. Do the same again to convert the text to all caps. Then copy the resulting text back into the Excel column from which it came.
Once the Excel text is in its final form, Word can be used to convert it to a more usable form. Copy all the code to be used to a Word file, select "Keep Text Only" using the "Paste Options" icon, and use the "Find and Replace" function to remove all the tabs in the text. Copy the resultant code to a preferred text editor for use.