Talent borrows... Genius steals

A lazy man's guide to working with Microsoft technology

Creating Word Building Block Footers

clock April 23, 2009 16:56 by author Jay

I’ve been trying to create some building blocks for a new template I’m building. One of the things I needed to do is be able to swap footers. I’ve tried a couple of methods which I’ll blog about later, but the method leading to this blog post was deciding to use the out-of-the-box Footer Quick Part functionality.

The first thing I did was simply create a custom footer, select all the text and then save it to the Quick Parts Gallery. I created a new document and inserted my customer footer from the Gallery. Hey, it did exactly as I expected it to do. Since the overarching functionality I need is to be able to swap footers, I selected another footer from the Footer Gallery.

What happened is it just added the content of the other footer to my custom footer already at the bottom of the page. Definitely not what I expected. So, I delete the footer from my page and insert one directly from the Footer Gallery. Then I pick another footer from the Footer Gallery. Sure enough, when swapping between different footers from the Footer Gallery, they replace each other.

So, if you want to actually create a custom footer, be sure to save it to the actual Footer Gallery. Apparently Word is doing some special processing when inserting items from this gallery, and presumably some of the others, that it doesn’t do with other Building Blocks.



Why is this so hard? Changing the default namespace in a VSTO project

clock April 2, 2009 18:21 by author Jay

Ok, so I’m getting back to development after a hiatus and decided to tackle a Word add-in for my company. It’ll really help me to be productive when I get it done so I figure it’s worth a little bit of investment on my part.

I go and fire up Visual Studio 2008 and create a new Word Add-in project. Give it a name and when I look at the namespace I see:

image

This is the name of my project. When I go to change it via Project Properties I see:

image

Ok, this is odd. The Root namespace property is disabled and is set to the sane name as my project file. Doing some quick searches I find that VSTO disables your ability to change the namespace. You need to name your project with the name you want to use for your namespace.

Well, I found someone that make have a workaround here. Haven’t tested it yet, so I can’t confirm it does as expected.



About the author

Something about the author

Tag cloud

    Page List

    Sign in