This project has moved and is read-only. For the latest updates, please go here.

Document Formatting

Sep 5, 2013 at 6:59 PM
Edited Sep 5, 2013 at 7:04 PM
Hello,

I've got the Word ad-in to take some data from TFS and make it presentable. It works well for the first part - the taking data part - but leaves us with a problem afterwards in regards to making it presentable.

Once all the data's "ripped", it looks like this:

[WORK ITEM THINGS]
[WORK ITEM THINGS]
[WORK ITEM THINGS]
etc.

Repeat for a couple dozen work items and it quickly becomes a mess. What we're unable to figure out is how to insert some kind of break up between the imported work items, so that it looks a bit more like this:

HEADING
[WORK ITEM THINGS]
[WORK ITEM THINGS]

HEADING 2
Notes about heading two
[WORK ITEM THINGS]
[WORK ITEM THINGS]
Some more notes about the above work item
[WORK ITEM THINGS]

To wit, we can't seem to insert anything at all between the bookmarks. Whenever we try to select anything on a line and make a new line, it just carries down the bracket ([]) and disallows anything to be added outside of the imported data. Best we can come up with is ripping the data to an already formatted document and going about cut-and-pasting. I would rather not that we need to do that for several dozen work items each time a new one needs to be made.

This is probably something really simple I'm overlooking, but I've run out of ideas and want to see if anyone here has some solution. How do I go about inserting formatting between the bookmarks?

Thanks!

M.
Sep 6, 2013 at 9:19 AM
This is tricky, I am not sure if there is a way to insert between adjacent bookmarks. I can think of a couple of solutions.
  1. Use separate queries for each heading.
  2. Manually edit the range of the bookmark after adding your extra formatting.
  3. Cut the items from the insertion point down, insert your text, and then paste back the cut items after the insertion.
I accept that they are not ideal but that is all I can think of at the moment.

Regards

Rob