About Me

My photo
I'm currently the CTO for Hedgehog Technology a business dedicated to delivering Cloud based productivity solutions in Logistics

Friday, July 10, 2009

Slide deck from yesterday

Presented on Office 2007 and SharePoint integration yesterday, deck on Skydrive

Stay tuned for more detailed blog posts on Office Integration features.

8 comments:

Unknown said...

Ed,

I saw an old post by you on a Kathleen's Weblog about how to prevent printing content control placeholder text. I have searched your blog and haven't found any information on that topic. Would you mind, providing some guidance on how to achieve this?

Ed Richard said...

I ended up emptying the Content Control placeholder text in beforeprint event handler and reported it as a bug in Word that it prints the placeholder text.
Actually thanks for reminding me, I need tocheck this in 2010 ;-)

Let me know if you need the code, I have it but not right here with me.

Ed

Unknown said...
This comment has been removed by the author.
Unknown said...

The code would be great. I tried to work through it, but no luck. I am starting with existing content controls and I've had problems with identifying the index/ID of the controls. Thanks for the help.

gk

Ed Richard said...

OK, I'll lookup the code, meanwhile I remember I was using the the Tag property of each control to store a unique ID and had a little helper method to find them by ID/Tag.

Ed

Unknown said...

Hey Ed,

I'm having trouble with trying to obtain the tag of an existing content control. If you have that code, it would be helpful. Thanks again.

gk

Ed Richard said...

Sorry it took a while, here is the code:

//Clearing content for a control:

CcControl.LockContentControl = false;
CcControl.LockContents = false;
CcControl.Range.Text = "";


//Clearing a placeholder text:
occ.SetPlaceholderText(null, null, "");

/// Find content control in document by Tag, note the CC's in Headers and Footer are in a seperate collection.
private Word.ContentControl GetCC(string Tag)
{
foreach (Word.ContentControl cc in Application
.ActiveDocument.ContentControls)
{
if (cc.Tag == Tag)
{
return cc;
}
}

return null;
}


Although a loop like this looks expensive I have an Add-in/Template that uses this for 25+ controls in a doc and there's no performance problem at all.

HTH,
Ed

Unknown said...

Thanks, Ed. Here's hoping Microsoft realizes there is no value in printing an empty control and provides a fix sooner than later. Take care.

gk