6

I have a SharePoint document library with a custom document template attached to it. This document template is having lot of Quick part fields , which will pull metadata column values from the document library item into the word document.Everything is working fine in this functionality.My document is pulling data from the metadata columns. But no the issue is if the metadata property is blank the word document will show "[Column Name]" in the place where the value would have been shown if not blank.What i want to achieve is to hide those properties when the value is blank. I have followed this Blog to hide Document properties when value is blank.But this is not refreshing the value dynamically. ie it is working only if i download the created document and open the document and click F9 ie a manual process. All my documents are created through SP Designer workflow.

  • 1
    I don't think there is a way to have the document refresh itself automatically. The only option would be to save it as a macro-enabled document (.docm) and trigger the refresh from code on document opening – MdMazzotti Apr 16 '14 at 9:02
  • @MdMazzotti Does the macro enabled document have a client system dependency? Can you share any link if you have done this – Unnie Apr 22 '14 at 9:32
  • a docm can only be opened by Microsoft Word 2007+ (but other sw like OpenOffice Writer might be able to open it; I've never tested it though). – MdMazzotti Apr 22 '14 at 9:44
  • @Unnie did you found a solution. I am stuck on the same issue – Keshav Taurah Oct 18 '18 at 7:17
0

It is possible to hide empty fields Check this blog

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

  • Please consider adding some more details to your answer rather than posting link only answers. Once the link is broken your answer is of no use for community member. – Aakash Maurya Jul 7 '16 at 7:23
0

There is one way: You can remove the placeholder text from Word's XML.

I have found out, that when you rename docx file to zip file and unpack to some folder, there are XML Folder\word\glossary\document.xml and Folder\word\document.xml

For each PlaceHolder (in glossary\document.xml) there is some XML Node (<w:docPart>), where you can find this elements <w:t>[State]</w:t>.

Same elements elements <w:t>[State]</w:t> look in document.xml.

When you remove "[State]" from this elements all document properties will be empty. Unfortunatelly all document properties...

    <w:docPart>
        <w:docPartPr>
            <w:name w:val="6B065C21091C4A3EB2ED303418489498"/>
            <w:category>
                <w:name w:val="General"/>
                <w:gallery w:val="placeholder"/>
            </w:category>
            <w:types>
                <w:type w:val="bbPlcHdr"/>
            </w:types>
            <w:behaviors>
                <w:behavior w:val="content"/>
            </w:behaviors>
            <w:guid w:val="{C72BE424-6B80-4344-9F1D-E3C0E8226E6B}"/>
        </w:docPartPr>
        <w:docPartBody>
            <w:p w:rsidR="00967279" w:rsidRDefault="008A1C99">
                <w:r w:rsidRPr="00EE3CA7">
                    <w:rPr>
                        <w:rStyle w:val="PlaceholderText"/>
                    </w:rPr>
                    <w:t>[State]</w:t>
                </w:r>
            </w:p>
        </w:docPartBody>
    </w:docPart>
  • can you explain the procedures for it – Keshav Taurah Oct 18 '18 at 8:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.