John R. Durant's WebLog

Blog of "The" Office Developer

Moving Template Content and Custom Toolbars

Have you ever written great code for a Word template and then wished you had it in another template as well? It's not as hard as it may seem to move your code from one template to another. You could use good 'ol copy/paste and re-create the entire thing in the new template, but that's not so fun. Fortunately, Charles Kenyon has a pretty good description of how to git-r-done (copyright Larry the Cable Guy).

If you go up one level on Charles' site, you will find more tips for Word. It's a good list. He also links to a site by Dian Chapman on creating your own custom toolbars. Check it out.

I'm working on a Word->Excel XML transform. Basically, it takes a Word table and converts into SpreadsheetML via an XSLT. That way, it can all be done without invoking any OM. I'll blog about it when I'm done.

 Rock Thought for the Day: I just finished listening to Rage Against the Machine. Blows my mind every time. I bought Audioslave's first album. There are some really great riffs on some of the tracks that got no airplay. Tomorrow, I'll blog about my Stevie Ray Vaughan DVD. His version of Voodoo Child is killer. I had my own riff-revelation yesterday while playing my guitar. I have a decent riff that I will tease a little longer and see if I can turn it into a song.

Rock On

Published Monday, September 19, 2005 3:30 PM by johnrdurant

Comments

 

Nette Stilling said:

I often need to copy forms and code from one Word Template to another. And sometimes even from Excel to Word (adjusting a few things so the code will run smoothly in Word).

Instead of dragging-and-dropping the forms and modules in the VB Editor (I don’t find the Organizer is suitable for my purpose), I’ve created a global template with a form that lists all forms, modules and classes in open templates and workbooks. I then select the forms, modules etc. I want to copy to my active document/template and create a copy (what I’m actually doing by code is exporting the forms, modules etc. and then importing them into the active document/template).
September 20, 2005 9:31 AM
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker