Easy Office application development

Daily Newsletters

Sign up to ZDNet UK's daily newsletter.

Let's learn from others
Now we come to a feature that for some people will be reason enough to get MOD: the Code Librarian. One of the best ways to learn to program is to read others' code. The problem comes in finding the right code snippet you need at the time. Digging through online help can be tedious, and the Knowledge Base doesn't always have what you need. The Code Librarian is a combination of an Access database and a custom front end, accessible from within the VBA editing environment. Simply choose Code Librarian from the Add-Ins menu, and pretty soon you'll be browsing code samples to your heart's content. Suppose, for example, that you've decided it's time to take off the training wheels (the ADO Data Control) and begin doing data access through ADO code. You fire up the Code Librarian, open the "booklet" marked ADO, and you see a screen like the one that appears in Figure C.
Figure C
Inside the ADO section are subsections: ADO Samples, ADO Samples With Oracle, and Jet Provider. When you click on the first subsection, the right-hand pane will fill with a list box of the individual samples (actually, records in the database). When you choose, say, Using The ODBC OLE-DB Provider in the record pane (as I've done above), the lower right-hand pane -- the Description pane -- will show a text description of the code snippet. If you then double-click the snippet name, you'll see the actual code in a new tabbed window (Figure D).
Figure D
The Code tab, obviously, shows the sample code. The Description tab contains the description that you saw when you clicked on the name, and the Settings tab allows you to set which booklet your code sample is assigned to. Once you've opened the code sample you want, you can do some or all of the following with it:
  • Use the mouse to select part or all of it and then copy it to the Clipboard.
  • Click the Insert Code To Module button to insert the code snippet into the currently active module in the Visual Basic Editor.
  • Click the Copy To Clipboard button to perform a copy-and-paste action.
What makes the Code Librarian really compelling is that it's editable. You can collect, store, and organise your own code snippets or those of your team or company. Suppose that, after a two-hour research-and-test sequence, you've finally been able to build a connection string that your company's SQL back-end server will accept. You think, "I don't want to have to figure that out again," so you create a new record in the code library, add the connect string, a name, and a description, and save it for future use. Now imagine that the code library is not on your personal PC but is in a shared location on your network. When you figure out your connection string and share it via the Code Librarian, all the other folks on your team will have access to the same code. This feature alone is worth the price of admission. Where are my tools?
If you've installed MOD but don't see any of the tools under the Add-Ins menu, you may have to load them. Perform the following steps to make sure you have all the tools:
  1. Choose Tools | Add-In Manager (Figure E).
  2. Click on the tool you want to use and select the Loaded/Unloaded option. (Or simply double-click the tool name.) This should change the status of the tool to Loaded.
  3. If you want the tool to always be available, select Load On Startup.
Figure E
Note that Help Workshop and Answer Wizard Builder are stand-alone applications listed in their own sections of the Start menu.
Have your say instantly in the
Tech Update forum. Find out what's where in the new Tech Update with our
Guided Tour. Let the editors know what you think in the
Mailroom.

Post your comment

In order to post a comment you need to be registered and logged in.

You can also log in with Facebook. Log in or create your ZDNet UK account below

  • Login

Will not be displayed with your comment

By signing up for this service, you indicate that you agree to our Terms and Conditions and have read and understood our Privacy Policy. Questions about membership? Find the answers in the Community FAQ

Get ZDNet UK's daily newsletter

Enter your email address to sign up

ZDNet UK Live

apexwm

I don't understand why there cannot be a slight pause during the boot process so the user can press a key. Many operating systems do this, even if...

47 minutes ago by apexwm on Windows 8 start-up speed forces USB boot workaround
Gavin Goodman

You can now buy the Xi3 modular computer in the UK at http://www.ocdistribution.com . This can be bought with the Tand3m software, pricing and...

1 hour ago by Gavin Goodman on CES 2012: Xi3 microSERV3R
Phil at Cloud4

I agree: Mike Lynch can clearly build a business and manage strategy. I suspect the exit of Mike is more likely the end of a planned handover...

5 hours ago by Phil at Cloud4 on HP cuts 27,000 staff as Autonomy chief Lynch leaves
Phil at Cloud4

This is unbeleivable government wastage with only one winner... Microsoft 1 - Tax payer Nil!

5 hours ago by Phil at Cloud4 on 6 million wasted licences and £1,200 PCs: welcome to government IT
Mispam

So what do you do when you can't boot into windows? Why can't I just hold Shift while I power up instead of having to boot into windows and click a...

6 hours ago by Mispam on Windows 8 start-up speed forces USB boot workaround
apexwm

I've also seen that Mac OS X for Intel machines is supposed to run in VirtualBox, which would also be a nice solution. I've never tried it though.

7 hours ago by apexwm on xTreme Triple Booting: Linux, Mac & Windows
dave heasman

What I wonder is why when companies are caught bang to rights in not providing contracted services, people bend over to smear the customers? Surely...

8 hours ago by dave heasman on Virgin throttles broadband for high-speed customers
pjc158

Strange statement from HP regarding Mike Lynch and not capable of scaling a company. Autonomy was a $7bn purchase which started as a small company...

8 hours ago by pjc158 on HP cuts 27,000 staff as Autonomy chief Lynch leaves
lojolondon

Or - possibly, they will destroy business by ensuring people do not invest where there is no return. Another socialist idea, well beyond it's...

11 hours ago by lojolondon on Open Data Institute will act as biz incubator
J.A. Watson

Good stuff Jake, very interesting. Thanks. jw

12 hours ago by J.A. Watson on xTreme Triple Booting: Linux, Mac & Windows
openhgs

"the cost of a second LCD screen is about the same as one day of an office worker's time, so this should soon be recouped in extra productivity."...

13 hours ago by openhgs on Windows 8 could speed multi-monitor uptake
Thomas Gellhaus

I also installed the KDE version; I also will probably try out razorqt since I really haven't had a chance to before. I'm looking forward to the...

23 hours ago by Thomas Gellhaus via Facebook on Mageia 2 Released
francisabigail

Acquiring when reinvention/cannibalization is too challenging for a large organization can be an excellent strategy- still, so many mergers stumble...

1 day ago by francisabigail on Ariba buy parks SAP on Oracle's cloud turf
apexwm

All of the feedback regarding using a touch monitor for a desktop PC is right on. Several months ago, we installed a "demo" multitouch all-in-one...

1 day ago by apexwm on Windows 8 could speed multi-monitor uptake
191706

anyone wanting to triple boot *their* own Mac

1 day ago by 191706 on xTreme Triple Booting: Linux, Mac & Windows
SoapyTablet

Cont.. Biggest Bugbear: Win7's stop-animate-go approach to work, you develop a staggered (not in the above alchohol sense of the word) approach to...

1 day ago by SoapyTablet on Windows 8 could speed multi-monitor uptake
SoapyTablet

Ah the joys of Windows 8 Consumer Preview... If Windows 7 was 'Vista with Lipstick', whats Windows 8? Vista with Lipstick, the morning after?...

1 day ago by SoapyTablet on Windows 8 could speed multi-monitor uptake
daveveej

Though the metro look is quite cool on the windows mobile platform I think that think that microsoft ARE MESSING THINGS UP because what has they...

1 day ago by daveveej on Windows 8 could speed multi-monitor uptake
Custonian

I agree, we have a few touch screen monitors in work but as Windows7 and the applications we use are not touch screen friendly (the size of the...

1 day ago by Custonian on Windows 8 could speed multi-monitor uptake
archerthom

I find it amusing that Microsoft added the mouse, which was deemed awkward, but people were forced to use it so it stuck, and now they're saying,...

1 day ago by archerthom on Windows 8 could speed multi-monitor uptake