# ดูหรือแก้ไขข้อมูลเมตาของไฟล์ PPT โดยใช้ C++

> ซอร์สโค้ด C++ เพื่อแก้ไขหรือดูข้อมูลเมตาของรูปแบบ PPT

Source: https://products.aspose.com/slides/th/cpp/metadata/ppt/
Updated: 2023-04-25



## แก้ไขคุณสมบัติ PPT ผ่าน C++

เมื่อใช้ Aspose.Slides for C++ นักพัฒนาสามารถเข้าถึงและแก้ไขค่าของคุณสมบัติในตัวรวมถึงคุณสมบัติที่กำหนดเอง นักพัฒนาสามารถใช้คุณสมบัติ [DocumentProperties](https://reference.aspose.com/slides/cpp/aspose.slides/documentproperties/) ที่เปิดเผยโดยออบเจกต์การนำเสนอเพื่อเข้าถึงคุณสมบัติเอกสารของไฟล์การนำเสนอ

### แก้ไข PPT คุณสมบัติในตัว - C++

```cpp

// Instantiate the Presentation class that represents the Presentation
System::SharedPtr<Presentation> presentation = System::MakeObject<Presentation>(u"presentation.ppt");

// Create a reference to IDocumentProperties object associated with Presentation
System::SharedPtr<IDocumentProperties> documentProperties = presentation->get_DocumentProperties();

// Set the builtin properties
documentProperties->set_Author(u"New Author");
documentProperties->set_Title(u"New Title");

// Save your presentation to a file
presentation->Save(u"DocumentProperties_out.ppt", SaveFormat::Ppt);
```

### เพิ่มคุณสมบัติที่กำหนดเองใน PPT - C++

```cpp

// Instantiate the Presentation class
auto presentation = System::MakeObject<Presentation>();

// Getting Document Properties
auto documentProperties = presentation->get_DocumentProperties();

// Adding Custom properties
documentProperties->idx_set(u"New Custom", ObjectExt::Box<int32_t>(12));
documentProperties->idx_set(u"My Name", ObjectExt::Box<String>(u"Aspose Metadata Editor"));
documentProperties->idx_set(u"Custom", ObjectExt::Box<int32_t>(124));

// Getting property name at particular index
String getPropertyName = documentProperties->GetCustomPropertyName(2);

// Removing selected property
documentProperties->RemoveCustomProperty(getPropertyName);

// Saving presentation
presentation->Save(u"CustomDocumentProperties_out.ppt", SaveFormat::Ppt);
```

## วิธีดึงข้อมูลเมตาของ PPT ผ่าน C++

นี่คือขั้นตอนในการดึงข้อมูลเมตาจากไฟล์ PPT

สร้างอินสแตนซ์ของคลาสงานนำเสนอด้วยพาธไปยังไฟล์ PPT

รับวัตถุ DocumentProperties ที่เกี่ยวข้องกับการนำเสนอ

วนซ้ำรายการในวัตถุ DocumentProperties

เข้าถึงและแก้ไขคุณสมบัติแบบกำหนดเอง

## รูปแบบ Metadata อื่นๆ ที่รองรับ
