none
Problem beim auslesen von BuiltInDocumentProperties/CustomDocument Properties Word 2010 RRS feed

  • Allgemeine Diskussion

  • Hallo,

    ich habe ein Problem beim auslesen von CustomDocumentProperties in einer Word Datei (Office 2010). Auch die BuiltInDocumentProperties sind mit folgendem Source immer null. Woran liegt das?:

    using Microsoft.Office.Core;
    using Word = Microsoft.Office.Interop.Word;
    .....
            private void toolStripMenuItemTmp_Click(object sender, EventArgs e)
            {
                Word.Application word = new Word.Application();
                Word.Document document = word.Documents.Open(@"C:\Users\fillibuster\Desktop\docproperty.docx");
                DocumentProperties properties = (DocumentProperties)document.CustomDocumentProperties;
                if (properties != null)
                {
                    foreach (Microsoft.Office.Core.DocumentProperty item in properties)
                    {
                        MessageBox.Show(item.Name.ToString() + item.Value.ToString());
                    }
                }
                else
                {
                    MessageBox.Show("null");
                }
            }

    CustomDocumentProperties habe ich erstellt. Die BuiltInDocumentProperties wie Titel sind gefüllt.

    Vielen Dank,
    Stefan

    Achtung Crosspost: http://www.mycsharp.de/wbb2/thread.php?threadid=115215


    Montag, 24. August 2015 06:32

Alle Antworten