Word Interop

There are 4 entries for the tag Word Interop
C# and Word Interop Part 4 - Tables

Previously we've looked at using Word Interop for creating dynamic documents, ranging from the simple, to the more in-depth, methods of working with Word from C#.  Check out Part 1, Part 2, and Part 3 to learn about working with bookmarks, ranges, images, and other tidbits.  Barring any more specific requests for information this will be the final installment, so I can get this stuff out of my brain and forget it ever happened. Tables are a great way to add both visual structure and navigability to your documents.  Creating a table structure in your templates can make you less reliant...

posted @ Tuesday, May 08, 2007 2:52 PM | Feedback (0)

C# Word Interop Part III - Various Tidbits

I know I said I'd talk about tables next, but I'll do those later.  For now I want to discuss just a few handy little things I picked up along the way. Putting Images in a Word Doc Someone asked about this in the comments to my last post.  I don't know that this is the *best* way to put images in the document, but it's the easiest way I've found, with the least intrusive amount of code:   //get Range for your insert point, like via bookmark Object bookmark = "InsertRange";Range insertRange = wordDocument.Bookmarks.get_Item(ref bookmark).Range;//get a System.Drawing.Image //obviously you could get the image...

posted @ Monday, May 07, 2007 4:47 PM | Feedback (0)

C# Word Interop Part Deux - The Revenge of the Range

In the last post about interop I gave you some basic code and techniques to do some really basic word document interaction.  In this one, I'm going to go beyond that and get into some more advanced document interaction.  I learned most of this because someone who no longer works for me locked us into Word as our "reporting platform", but at the 11th hour I realized the reports weren't really all that...implemented....and I had to basically start from scratch.  I was displeased.  Fair warning - if you find yourself needing this information, I beg you to find another way to do...

posted @ Monday, May 07, 2007 5:02 AM | Feedback (0)

C# and Word Interop - A Few Tips

In my last project I had to do A LOT of Word Interop.  Everything from data-heavy reports to quick documents exist in this system.  Let me start by saying if you can find a way for to do what you want WITHOUT using Word Interop....do it.  It's such a pain in the ass if you want to do anything non-trivial. Some things word interop really shines for is allowing you to preformat a document and just "fill in the blanks" with some data.  This is great if you're doing something like Packing Slips, cover sheets, and other simple documents. Basic Word Interop Let's...

posted @ Thursday, May 03, 2007 3:46 PM | Feedback (0)