none
Content Control Tag/Title (Alias) RRS feed

  • Question

  • Zeyad (and others).   Quick question regarding Content Controls.  When using Word 2007 (application or through automation), tag and title are limited to 64 characters max.  When setting it through SDK, there is no limit.

    Is there a reason for 64 char limit and will it still be there in next version of Word?  I don't know if my case is specific (or maybe I am misusing it), but if Content Controls are to be utilized as most of us are using them, 64 char limit might be too small.  

    To explain my scenario.  I have a large number of documents that we built a custom tags that are replaced in the runtime.  We are trying to use SDK now to avoid automation (and to make it available serverside as well).  In current document I have a tag like {{some tag}}.  I have build a solution that uses SDK and processes our templates and it works great and actually really reliable.  What I have done is instead of free text in the document  {{some tag}} I inserted a content control and gave it tag/title {{some tag}} (I didn't want to use place holder text because it could be broken in multiple runs, etc). 

    Now I am trying to build a converter that will convert old templates to new.  I am using automation for this.  Unfortunatelly some of our tags are larger than 64 chars and converter fails. 

    Hopefully I am not out of line (as in wrong place to ask) with my question.

    Thanks


    Tuesday, March 17, 2009 7:08 PM

All replies

  • Every application has some kind of limit. For Word, the limit is 64 characters for content control names. Is there any way that you can convert your old tags to unique names or GUIDs that can fit within the 64 character limit? Essentially all you need to do is make your content controls uniquely identifiable.

    Zeyad Rajabi

    Zeyad Rajabi (MS)
    Thursday, March 19, 2009 4:16 AM
  • Thanks Zeyad.   

    I decided to use place holder text after all.  Using automation when doc is "converted" I replace current tag (which user can type and it can have multiple parameters, etc) with a content control and set Content Control's Tag/Title to be just the tags name and put the full text of the tag in the place holder text.  Reason I was skeptic doing is for search in case place holder text is broken into multiple runs.  But, since I put the actual tag name in Alias I can search on that.  Once it finds the tag I simple go throug all descendants inside the content control and grab all of type Text and concat them together to get the full version of the tag.  Since I am in control during my conversion of putting the placeholder text, I think this would be a relatively safe approach.

    Thanks
    Friday, March 20, 2009 6:35 PM