http://support.microsoft.com/default.aspx?kbid=303296

解决方案 »

  1.   

    the code is used for Excel:
    private void DisplayDocumentProperties()
    {
        Office.DocumentProperty prp = null;
        Office.DocumentProperties prps = 
            (Office.DocumentProperties) 
            ThisWorkbook.BuiltinDocumentProperties;    Excel.Range rng = ThisApplication.
            get_Range("DocumentProperties", Type.Missing);
        int i = 0;    try 
        {
            ThisApplication.ScreenUpdating = false;        try 
            {
                // Set the Revision Number property:
                prp = prps["Revision Number"];
          prp.Value = Convert.ToInt32(prp.Value) + 1;            // Dump contents of the collection:
                i = DumpPropertyCollection(prps, rng, i);
            } 
            catch (Exception ex) 
            {
                MessageBox.Show(ex.Message, ThisApplication.Name);
            }        // Work with custom properties:
            try 
            {
          prps = (Office.DocumentProperties)
            ThisWorkbook.CustomDocumentProperties;
                DumpPropertyCollection(prps, rng, i);
            } 
            catch (Exception ex) 
            {
                MessageBox.Show(ex.Message, ThisApplication.Name);
            }        // Add a custom property:
            try 
            {
                // Delete the property, if it exists.
                prp = prps["Project Name"];
                prp.Delete();
            } 
            catch
            {
                // Do nothing if you get an exception.
            }
            try 
            {
                // Add a new property.
                prp = prps.Add("Project Name", false, 
                    Office.MsoDocProperties.msoPropertyTypeString,         
                    "White Papers", Type.Missing);
            } 
            catch (Exception ex) 
            {
                MessageBox.Show(ex.Message, ThisApplication.Name);
            }
        } 
        finally 
        {
            ThisApplication.ScreenUpdating = true;
        }
    }private int DumpPropertyCollection(
        Office.DocumentProperties prps, Excel.Range rng, int i) 
    {
        foreach (Office.DocumentProperty prp in prps)
        {
            rng.get_Offset(i, 0).Value2 = prp.Name;
            try 
            {
                if (prp.Value != null ) 
                {
                    rng.get_Offset(i, 1).Value2 = 
                        prp.Value.ToString();
                }
            } 
            catch
            {
                // Do nothing at all.
            }
            i += 1;
        }
        return i;
    }
      

  2.   

    to whnnet(赚钱攒嫁妆)
    姐姐,能给出其他项目的英文名称吗,
    比如作者是Auther
    给分
      

  3.   

    给出其他项目的英文名称吗,
    比如作者是Auther
    给分