ContentTypePropertyCollection.Add

Add(string, string)

Adds content type property information.

public int Add(string name, string value)
ParameterTypeDescription
nameStringThe name of the content type property.
valueStringThe value of the content type property.

Examples

using System;
using Aspose.Cells;
using Aspose.Cells.Properties;

namespace AsposeCellsExamples
{
    public class ContentTypePropertyCollectionMethodAddWithStringStringDemo
    {
        public static void Run()
        {
            Workbook wb = new Workbook();
            ContentTypePropertyCollection ctps = wb.ContentTypeProperties;
            ctps.Add("CustomProperty1", "SampleValue1");
            ctps.Add("CustomProperty2", "SampleValue2");
            
            wb.Save("output.xlsx");
        }
    }
}

See Also


Add(string, string, string)

Adds content type property information.

public int Add(string name, string value, string type)
ParameterTypeDescription
nameStringThe name of the content type property.
valueStringThe value of the content type property.
typeStringThe type of the content type property.

Examples

using System;
using Aspose.Cells;

namespace AsposeCellsExamples
{
    public class ContentTypePropertyCollectionMethodAddWithStringStringStringDemo
    {
        public static void Run()
        {
            Workbook workbook = new Workbook();
            workbook.ContentTypeProperties.Add("propertyName", "propertyValue", "string");
            workbook.Save("output.xlsx");
        }
    }
}

See Also