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

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

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



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

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

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

```cpp

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

// 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.potx", SaveFormat::Potx);
```

### เพิ่มคุณสมบัติที่กำหนดเองใน POTX - 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.potx", SaveFormat::Potx);
```

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

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

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

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

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

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

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