Automatically inserting rich text content control

I have many word .docx forms which I would like to convert to a form which can be filled in with Reader.  The word forms presently would be like ...we [name of parties] desire to enter into...
I would like to have a program which automatically finds the brackets and inserts a rich text content control box and then inserts whatever is within the brackets for the placeholder wording.
Can this be done and if so, is it code in XML or am I totally off my rocker?
Thanks

Hi Peter,
According to the description, you are using OPCHelper converting the Word document into byte. As far as I know, the OPCHelper is a third-part class, I suggest contact the vendor to get more effective response.
For this issue, did you want to retrieve byte data from the Office package? And based on my understanding, the office document support Open XML format is a zip. We can directly get the data from the zip package via
GZipStream.
Hope it is helpful, and if I misunderstood please feel free to correct me.
Regards & Fei 
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Open xml relationship target is NULL when inserting chart into a mapped rich text content control in Word 2013

    Hi,
    I have a word document with a rich text content control that is mapped to a CustomXml. You can download an example here
    http://1drv.ms/1raxoUr
    I have looked into the specification ISO/IEC 29500-1:2012 and i understand that the attribute Target for the element Relationship can be set to NULL at times(Empty header and footer in the specification).
    Now, i have stumbled on Target being NULL also when inserting a diagram into a word document. For example:
    <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"
    Target="NULL" TargetMode="External" xmlns="http://schemas.openxmlformats.org/package/2006/relationships" />
    Why is Target="NULL" and how should i interpret that Target is null?
    Br,
    /Peter
    Peter

    Hello Peter,
    The relationship in question is associated with the externalData element (ISO/IEC 29500-1:2012 §21.2.2.63). For the other two charts in this document, the corresponding relationships are of the other allowable form:
      <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/package" Target="../embeddings/Microsoft_Excel_Worksheet1.xlsx"/>  <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/package" Target="../embeddings/Microsoft_Excel_Worksheet2.xlsx"/>
    For charts 1 and 3 in your document, the data can be edited via the Chart Tools ribbon control. The option to edit data is not available for chart 2. The data used to create chart 2 is the same default spreadsheet data used for chart 1, and in fact the spreadsheet
    references are still present in the file format, despite there being no apparent link to a spreadsheet for chart 2.
    Thus, it appears that Target="NULL" in this context means that the chart is not associated with an external data source. The specification doesn't have much to say about the semantics of the Target attribute (ISO/IEC 29500-2:2012 §9.3.2.2) beyond
    the fact that it be a valid xsd:anyURI, which the string "NULL" is.
    It looks like there is some unexpected interaction between the chart and the content control. I don't think the file format is the issue. You will probably need to pursue that behavior from the product perspective via a support incident, if that behavior
    is unexpected. If you still have questions about what is seen in the file format, please let me know.
    Best regards,
    Matt Weber | Microsoft Open Specifications Team

  • Word 2013 - Bulleted list inside rich text content control

    Hi,
    I'm mapping a rich text content control to an xml node within my custom xml.
    While i'm in design mode i try to format the text so that it will be a numbered list.
    One thing that i noted though was that the numbers are placed outside the content control. This is only my first observation.
    The thing is, the rich text(RTF) that is saved within the custom xml is later used to populate a second document. This works great except for one small issue. The numbered list is not showing up within the second document.
    Would appreciate any help i can get with this issue.
    Br,
    /Peter
    Peter

    Hi Peter
    This is tricky, because...
    By default, when you insert a new RichText content control it will not include the paragraph mark for the paragraph it's in. Numbering is a paragraph-level formatting.
    If you work in Word, you can see this. Turn  on the display of non-printing characters (the backwards P button in the "Home" tab of the Ribbon). Insert a RT content control and observe where the paragraph mark (backwards P) is in relation to the
    CC's boundaries. Now press ENTER and observe that the paragraph mark is WITHIN the CC. Apply number formatting and you'll see that it's NOW inside the CC.
    You can do this the other way around: apply the numbering then press ENTER. Again, it should now be within the CC.
    This behavior is by-design. I would guess that lists the users type would have more than entry, so the numbering will be within the CC range when the custom XML is extracted?
    Cindy Meister, VSTO/Word MVP,
    my blog

  • Word 2010 Copy Rich Text Content Control

    I am working on a Word 2010 template that links to another word document to copy information from Rich Text Content Controls.  I am able to copy values between RTF controls but losing the rich text formatting - only text is copied over.
    Any Suggestions on how to copy between rich text controls and still preserve the formatting?
      Set sourceCCs = sourceDoc.SelectContentControlsByTag(sourceCCTag)
        If Not (IsNull(sourceCCs)) Then
            For Each sourceCC In sourceCCs
                Set editCCs = editDoc.SelectContentControlsByTag(editCCTag)
                If Not (IsNull(editCCs)) Then
                    For Each editCC In editCCs
                        If appendText Then
                            'editCC.Range.Text = editCC.Range.Text & vbCrLf & sourceCC.Range.Text
                            editCC.Range = editCC.Range & vbCrLf & sourceCC.Range
                        Else
                            'editCC.Range.Text = sourceCC.Range.Text
                            editCC.Range = sourceCC.Range
                        End If
                    Next
                End If
            Next
        End If
    Thanks in advance

    Try something along the lines of:
      Set sourceCCs = sourceDoc.SelectContentControlsByTag(sourceCCTag)
      If Not (IsNull(sourceCCs)) Then
        For Each sourceCC In sourceCCs
          Set editCCs = editDoc.SelectContentControlsByTag(editCCTag)
          If Not (IsNull(editCCs)) Then
            For Each editCC In editCCs
              With editCC.Range
                If appendText Then
                  .InsertAfter vbCr
                  .Collapse wdCollapseEnd
                End If
                .FormattedText = sourceCC.Range.FormattedText
              End With
            Next
          End If
        Next
      End If
    Cheers
    Paul Edstein
    [MS MVP - Word]

  • Handling RICH TEXT content on BI publisher report

    Hello,
    I have requirment where I have to handle RICH TEXT content, and show data in report with RICH TEXT formating.
    The RICH TEXT content(with tags) is comming from database CLOB column. Here is the sample XML data.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <DATA_DS>
    - <G_1>
    <ID>1</ID>
    <RICH_TEXT_DATE>'<p' class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-line-height-alt: 1.15pt">'<span' style="FONT-FAMILY: Arial Narrow,sans-serif; mso-bidi-font-family: bold; Tahoma">'<font' size="3">Testing data for rich text '</font'>'</span'>'</p'></RICH_TEXT_DATE>
    </G_1>
    </DATA_DS>
    Report Output should be below with all the formating:-
    <p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-line-height-alt: 1.15pt"><span style="FONT-FAMILY: Arial Narrow,sans-serif; mso-bidi-font-family: bold; Tahoma"><font size="3">Testing data for rich text</font></span></p> <p></p>So, how to get above output with all formating, Please let me you soultions.
    I am using, Oracle BI Publisher desktop version 11.1.1.5
    Thanks in advance.
    San.

    https://blogs.oracle.com/xmlpublisher/entry/html_in_xml_support
    http://docs.oracle.com/cd/E23943_01/bi.1111/e22254/create_rtf_tmpl.htm#CHDCEEIJ
    Rendering HTML Formatted Data in a Report : <BR/>  are not being parsed

  • How to send a mail with rich text content like using outlook

    Hi All. I have a serious problem. When we send the mail from
    outlook express or yahoo, we can send the mail with the text appearing
    in the mail with bold font , with different colors, underlined etc.
    If i type this kind of text in any word processor and mail that content through java mail then the message should be received by the recepient with all that bold,color and underlines etc as it is. Can anybody please help me in this case ASAP.

    Go to this site and download the htmlArea Javascripts. Embedd them in your HTML and it will turn your normal HTML Text Area into Rich Text Area. Your real code will include all HTML tags. For example if you select some text and make it bold , the real HTML output will look like <B>YOUR TEXT </B>. So i guess your recipient should be able to receive HTML contents.
    http://www.interactivetools.com/products/htmlarea/

  • Automatic insertion in text box?

    Hello,
    Here is the problem...I have existing .indd document, and it needs to be printed into large number of pdf files. Each pdf file must have different text in one textbox (located in master frame). Is there any way i could automate the process? Not so much for printing, but for automatic insertion of that text line by mouse click/command? I figure that automatic printing would be difficult, since each file goes to different folder...
    This would not be the case if it was one time job, but I am doing it manually for a long time, each several days
    Thank you for answers

    Thank you peter, with Data Merge I have managed to do exactly what I wanted, even easier than i taught it could be done, using Excel
    Automatic printing to specified folders and automatic shifting of data fields seems like to complicated, and like something indesign was not designed to do...so it can be skipped Tnx!

  • How to fix width of plain text content control in Microsoft Word 2010?

    I try to make the simplest solution for my custom to modify current Word template without hard code anything except field name.
    As you can see above image, normally text field in Word is not fixed width control. So, it may affect document layout. Moreover, I want to add dotted line below all text fields in document template.
    Is there any possible solution that end-user can do in normal Microsoft Word 2010 application?
    PS. I will fill all controls with data from Microsoft Access.

    In PDF file, I can easily create fix-size absolute position field inside document template like the following document. In Microsoft Word, I cannot fix even the size of plain text field.
    PS. Nobody use table with fixed cell size as normal form (hard copy). I think Microsoft Word is really bad choice for creating any document template by end-user.
    Criticizing Word for not doing the same as some other application is hardly relevant. Have you tried word-processing with Adobe Acrobat?
    As for your PS, Word tables are ideal for the kind of thing you describe. Your assertion that 'nobody' does so is plain ignorance - it is a common practice. In my previous employment,
    many forms were created using Word tables. Before complaining Word is a 'really bad choice', you should learn how to use it.
    Cheers
    Paul Edstein
    [MS MVP - Word]

  • Automatic Insertion of Text

    I am running MS Word 2011.  Every time I type my last name  "Mucci" and then press either the tab key, the enter key or the space bar, MS World inserts a strange combination of characters.  See
    below.
    "MuMucci6ytgfvb cfrt4554erfdcxsdwe3ZXCFDGTHYU78900-PO;L.,'[P-="
    It is I do not know how this problem began, so I do not know how to eliminate it.  I have tried deleting it using the Customize option for custom keyboard
    strokes; the custom dictionary and the AutoText options for deleting custom building blocks.  I cannot even locate the source of the string
    Mu6ytgfvb cfrt4554erfdcxsdwe3ZXCFDGTHYU78900-PO;L.,'[P-="
    If anyone has an idea about how this string was created and where it might reside in MS World, please let me know.  Steve M
    St
    S
    IfI

    Hi,
    According the post, I know you are using Office for Mac. It is recommended to initial a new thread in Office for Mac forum for dedicated support via the link below.
    http://answers.microsoft.com/en-us/mac/forum/macoffice2011?tab=Threads
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Best Regards,
    Tracy Cai
    Tracy Cai
    TechNet Community Support

  • Insert a Picture into the Picture/Image Content Control using Open XML SDK 2.0

    I have created a word template as follows
    Here PizzaPicture is a Picture Content Control, PizzaName is a Plain Text Content Control and PizzaDescription is a Rich Text Content Control
    I am able to assign text to PizzaName and PizzaDescription Easily but not able to even locate the PizzaPicture. Here is my code
    using (WordprocessingDocument document = WordprocessingDocument.Open(@".\test.docx", true)) {
    MainDocumentPart mainPart = document.MainDocumentPart;
    DocumentFormat.OpenXml.Wordprocessing.Text text = null;
    SdtContentBlock pizzaNameBlock = null;
    SdtContentBlock pizzaDescriptionBlock = null;
    //SdtContentBlock pizzaPictureBlock = null;
    List<SdtBlock> sdtList = mainPart.Document.Descendants<SdtBlock>().ToList();
    foreach (SdtBlock sdt in sdtList)
    Console.WriteLine(sdt.SdtProperties.GetFirstChild<Tag>().Val.Value);
    SdtBlock s1 = mainPart.Document.Body.Descendants<SdtBlock>().Where(r => r.SdtProperties.GetFirstChild<Tag>().Val == "PizzaName").Single();
    SdtBlock s2 = mainPart.Document.Body.Descendants<SdtBlock>().Where(r => r.SdtProperties.GetFirstChild<Tag>().Val == "PizzaDescription").Single();
    SdtBlock s3 = mainPart.Document.Body.Descendants<SdtBlock>().FirstOrDefault(r =>
    SdtProperties p = r.Elements<SdtProperties>().FirstOrDefault();
    if (p != null)
    Console.WriteLine("P is not null");
    // Is it a picture content control?
    SdtContentPicture pict =
    p.Elements<SdtContentPicture>().FirstOrDefault();
    if (pict != null) Console.WriteLine("Pict is not null");
    // Get the alias.
    SdtAlias a = p.Elements<SdtAlias>().FirstOrDefault();
    if (pict != null && a.Val == "PizzaPicture")
    return true;
    return false;
    if (s3 == null) {
    Console.Write(" s3 is Null");
    } else {
    Console.WriteLine("s3 not null");
    if (s1 != null) {
    pizzaNameBlock = s1.Descendants<SdtContentBlock>().FirstOrDefault();
    text = pizzaNameBlock.Descendants<DocumentFormat.OpenXml.Wordprocessing.Text>().FirstOrDefault();
    // here you can set the current time
    text.Text = "Peperoni";
    Console.WriteLine(text.Text);
    string embed = null;
    if (s3 != null)
    Drawing dr = s3.Descendants<Drawing>().FirstOrDefault();
    if (dr != null)
    Blip blip = dr.Descendants<Blip>().FirstOrDefault();
    if (blip != null)
    embed = blip.Embed;
    if (embed != null)
    IdPartPair idpp = document.MainDocumentPart.Parts
    .Where(pa => pa.RelationshipId == embed).FirstOrDefault();
    if (idpp != null)
    ImagePart ip = (ImagePart)idpp.OpenXmlPart;
    using (FileStream fileStream =
    File.Open(@"c:\temp\pepperoni.jpg", FileMode.Open))
    ip.FeedData(fileStream);
    if (s2 != null) {
    pizzaDescriptionBlock = s2.Descendants<SdtContentBlock>().FirstOrDefault();
    string altChunkId = "AltChunkId12345";
    AlternativeFormatImportPart chunk = mainPart.AddAlternativeFormatImportPart(AlternativeFormatImportPartType.Xhtml, altChunkId);
    chunk.FeedData(File.Open(@".\html.txt", FileMode.Open));
    AltChunk altChunk = new AltChunk();
    altChunk.Id = altChunkId;
    ////Replace content control with altChunk information
    OpenXmlElement parent = pizzaDescriptionBlock.Parent;
    parent.InsertAfter(altChunk, pizzaDescriptionBlock);
    pizzaDescriptionBlock.Remove();
    mainPart.Document.Save();
    document.Close();
    Here the call mainPart.Document.Descendants<SdtBlock>().ToList(); returns me only 2 items PizzaName, PizzaDescription but
    no PizzaPicture.
    Secondly the line   SdtContentPicture pict =  p.Elements<SdtContentPicture>().FirstOrDefault();
    returns NULL. So it seems that there is no element of type SdtContentPicture.
    What am I doing wrong? I am pretty sure that I have put PizzaPicture as a Picture content control.
    My objective is to locate this control in the document and then insert an image into it programmatically.
    MSDNStudent Knows not much!

    Hi,
    I'm running some test on your code, and I'll come back as soon as I get some update. But before that, I would recommend you to bind customXMLPart with the content controls via Content Control Tool Kit,
    which enables us to bind customXMLPart with CC by dragging and dropping.
    After binding, you can change contents of the template via OpenXML SDK easily as the following code:
    private void button1_Click(object sender, EventArgs e)
    string fileName = @"C:\CCTest.docx";
    WordprocessingDocument wordDoc = WordprocessingDocument.Open(fileName, true);
    MainDocumentPart mainPart = wordDoc.MainDocumentPart;
    CustomXmlPart customPart = mainPart.CustomXmlParts.FirstOrDefault();
    //convert image into string
    string picName = @"C:\Users\Public\Pictures\Sample Pictures\Desert.jpg";
    System.IO.FileStream fileStream = System.IO.File.Open(picName, System.IO.FileMode.Open);
    System.IO.BinaryReader br = new System.IO.BinaryReader(fileStream);
    byte[] byteArea;
    byteArea = br.ReadBytes(System.Convert.ToInt32(fileStream.Length));
    string picString = System.Convert.ToBase64String(byteArea);
    //Load the XML template
    string DataString = Properties.Resources.XMLData;
    XmlDocument xmlDoc = new XmlDocument();
    xmlDoc.LoadXml(DataString);
    //change the value
    XmlNodeList xmlNode = xmlDoc.GetElementsByTagName("pizzaPic");
    xmlNode[0].InnerText = picString;
    xmlNode = xmlDoc.GetElementsByTagName("pizzaName");
    xmlNode[0].InnerText = "Pizza Name";
    xmlNode = xmlDoc.GetElementsByTagName("pizzaDescription");
    xmlNode[0].InnerText = "Pizza Description";
    //write the custom xml data into the customxmlpart
    System.Xml.XmlTextWriter writer = new System.Xml.XmlTextWriter(customPart.GetStream(System.IO.FileMode.Create), System.Text.Encoding.UTF8);
    writer.WriteRaw(xmlDoc.InnerXml);
    writer.Flush();
    writer.Close();
    fileStream.Close();
    br.Close();
    mainPart.Document.Save();
    wordDoc.Close();
    and the XML template of the project would something like:
    <?xml version="1.0"?>
    <Pizza xmlns="http://Test/ContentControls/Pizzas">
    <pizzaPic></pizzaPic>
    <pizzaName></pizzaName>
    <pizzaDescription></pizzaDescription>
    </Pizza>
    I hope this helps.
    Calvin Gao[MSFT]
    MSDN Community Support | Feedback to us

  • Identifying a content control in a Word 2013 document and accessing the current "text" value of the control.

    I'm new to VBA and need to better understand the syntax for identifying, accessing control "value" and setting the value from a user form.
    My task is this, I have a word document containing the new Content Controls. I need to be able to access each individual control to initialize a UserForm control. I then need to update the "values of the controls on exiting the UserForm. Can someone
    proved some simple sample code showing this functionality? I have surmised that the "range" attribute holds the value of the control but I need the textual or logical value of the control.
    Thanks.

    Hi Gunteacher,
    My task is this, I have a word document containing the new Content Controls. I need to be able to access each individual control to initialize a UserForm control. I then need to update the "values of the controls on exiting the UserForm.
    What's content control you are using? Based on my understanding, we can indentify the content control by its tag and get the value of content control and initialize the control on the userform in the initialize event of userform. For example,
    code below is that get the text of rich text content control:
    ActiveDocument.ContentControls(1).Range.Text
    And here are some helpful links about content control for your reference:
    ContentControl Object (Word)
    Working with Content Controls
    What did you mean "I then need to update the "values of the controls on exiting the UserForm."? Did you mean that when the values of content control is changed, it should update the control on the user form which was open before?
    As far as I know, there is no such event suitable for this secnario. If you want content control to support this event, I suggest that you submit the feedback from the "Smile Face" at the top right corner of Word.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • DITA + FM: How can I change the automatically insert text for the element info?

    Hello,
    when I insert the element info in a topic, FrameMaker automatically insert the text "ADDITIONAL INFORMATION:".
    How can I change that?
    I know how to change it for the elements result, postreq and prereq. I change the text format rules for the elements in the topic.edd.
    But the element info has no text format rules and when I search in the topic.edd for the text "additional" or "info" I dont find something.
    With kind regards,
    Nina

    Hi Scott,
    thanks a lot for your reply! I've found the code in the EDD on page 65.
    "... is using the @type attribute value ..." - I have changed the values in the DTD (Structure\xml\DITA\app\dtd\commonElements.mod), but that didn't had any effect, not even after a restart of FM. I also changed the note attribute values in "dita-map.edd.fm" and "topic.edd.fm". Nothing. When I insert a note tag FM still inserts the original values.
    Did I missunderstand something? Further tips?
    Marcel

  • Rich Text editor in Webdynpro

    Hi,
    With the new FormattedTextView in 2004s one will be able to render xhtml compliant rich test in Webdynpro.
    This however only covers the rednering of rich text.
    There still does not seem to be a rich text editor control available for webdynpro applications, which I think might be a common requirement for document centric applications.
    I was wondering :
    1 - will there be a richt text editor control available for WDP in the forseeable future ?
    2 - if not, are there any workardounds available to allow for the generation of rich text ?

    Hi Valery,
    Well, I already thought of that kind of solution, but I do not consider it a very clean solution. I know WDP supports portal eventing. On the other side of such a scenario you could even do without a 3rd party wysiwyg editor, cause SAP does offer an html editor control in its set of HTMLB controls.
    We intend to use WDP as a UI layer on top of SAPs KM. Our scenario involves template based publishing of structured documents (we first looked at xml forms, but they showed too many limitations). The idea is to model the document structure and content at runtime as WDP context structures (based on xml schemas) and then to serialize WDP context into XML content and metadata, with KM acting as business and persistence layer. Markup and insertion of images into the different text parts of the document however has become an additional requirement, which is why we are looking for a ways to fit that in our current design.
    You could indeed think of some kind of data exchange between a regular portal component and the wdp application, but I am not too confident whether that is going to be a reliable solution.
    PS : for the serialization of WDP context, your post in a different thread on this forum helped me a lot in my first attempts to create KM documents from data wdp runtime data (context). The link provided to the online book and your little example was very welcome. Thanks for that !

  • Rich Text Editor functionality for a DIV tag in a publishing page in SharePoint online

    Hi,
    We are having a requirement where we need RTE behavior of SharePoint 2013 Rich Html Field for a custom DIV. The scenario goes like this:
    1. I have a publishing page
    2. I dropped the content editor web part and to that content editor web part I will point to an HTML file that needs to be rendered in that content editor web part
    3. I have one DIV in the above mentioned HTML files and I want that div to be editable and I need to RTE options for that DIV.
    How to accomplish the above behavior?

    Hi,
    According to your post, my understanding is that you wanted to create html rich text editor for a DIV tag in a publishing page in SharePoint online.
    You can create your own Rich Text Editor.
    Here are some great blogs for your reference:
    An Example to Use HTML Rich Text Editor
    Example: Using the Editor's instance
    Rich Text Editor control in SharePoint 2010
    Regarding SharePoint Online, for quick and accurate answers to your questions, it is recommended that you initial a new thread in Office 365 forum.
    Office 365 forum
    http://community.office365.com/en-us/forums/default.aspx
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Rich text toolbar missing on a survey list in Sharepoint 2010

    Hi , 
    I created a Survey list in SP 2010 and added a 'Content Editor' webpart to it. The problem is that there is
    no Ribbon available in the Survey List in SP 2010. (While it is available in the a normal list) Why? Is it the default functionality of Sharepoint 2010?
    How can I add a rich text toolbar so that while editing the content webpart I can format the text. Is it possible?

    Hi Yasir,
    This behavior is by design. When you add a content editor web part on survey list page, you can only add the plain text.
    Have a try to add a rich text control
     InputFormTextBox to the overview.aspx page in SharePoint Designer, add the following code to code behind.
    <SharePoint:InputFormTextBoxRows="10"MaxLength="1000"id="txtMyRichTextBox"runat="server"RichText="true"RichTextMode="FullHtml"TextMode="MultiLine"
    Height="400px"Width="250px"></SharePoint:InputFormTextBox>
    For more information, see
    http://blog.mastykarz.nl/rich-text-editor-control-sharepoint-2010/
    Best Regards.
    Kelly Chen
    TechNet Community Support

Maybe you are looking for