# รวมไฟล์ POTM ผ่าน C++

> โค้ดตัวอย่าง C++ เพื่อรวมเอกสาร POTM บน C++ Runtime Environment สำหรับ Windows 32 บิต, Windows 64 บิต และ Linux 64 บิต

Source: https://products.aspose.com/slides/th/cpp/merger/potm/
Updated: 2026-08-11



## วิธีผสานไฟล์ POTM โดยใช้ C++

 ในการรวมไฟล์ POTM เราจะใช้
 [Aspose.Slides สำหรับ C++](https://products.aspose.com/slides/th/cpp/)
 API ซึ่งเป็น API การรวมเอกสารที่มีคุณสมบัติหลากหลาย มีประสิทธิภาพ และใช้งานง่ายสำหรับแพลตฟอร์ม C++ คุณสามารถดาวน์โหลดเวอร์ชันล่าสุดได้โดยตรง เพียงแค่เปิด
 [NuGet](https://www.nuget.org/packages/aspose.slides)
 package manager ค้นหา
 **Aspose.Slides.Cpp**
 และติดตั้ง คุณยังสามารถใช้คำสั่งต่อไปนี้จาก Package Manager Console

### สั่งการ

```cs

PM> Install-Package Aspose.Slides.Cpp

```

## ขั้นตอนในการรวมไฟล์ POTM ใน C++

เอกสารพื้นฐานที่ผสานและต่อด้วย [Aspose.Slides for C++](https://products.aspose.com/slides/th/cpp/) API สามารถทำได้โดยใช้โค้ดเพียงไม่กี่บรรทัด

โหลดไฟล์ POTM ทั้งสองไฟล์

ใช้วิธี get\_Slides() เพื่อวนซ้ำในแต่ละสไลด์

ใช้ฟังก์ชัน AddClone เพื่อรวมเข้ากับไฟล์ที่ต้องการ

ใช้วิธี Save() เพื่อบันทึกที่เส้นทางที่ระบุ

## ความต้องการของระบบ

 Aspose.Slides สำหรับ C ++ รองรับบนแพลตฟอร์มหลักและระบบปฏิบัติการทั้งหมด โปรดตรวจสอบให้แน่ใจว่าคุณมีข้อกำหนดเบื้องต้นดังต่อไปนี้

- Microsoft Windows หรือ OS ที่เข้ากันได้กับ C++ Runtime Environment สำหรับ Windows 32 บิต, Windows 64 บิต และ Linux 64 บิต
- Aspose.Slides สำหรับ C ++ DLL ที่อ้างอิงในโครงการของคุณ

### รวมไฟล์ POTM - C++

```cs
// The path to the documents directory.
const String sourceFilePath1 = u"SourceFile2.potm";
const String sourceFilePath2 = u"SourceFile3.potm";
const String outputFilePath = u"mergedOutput.potm";

// Instantiate Presentation class
SharedPtr<Presentation> presentation1 = MakeObject<Presentation>(sourceFilePath1);
SharedPtr<Presentation> presentation2 = MakeObject<Presentation>(sourceFilePath2);

for (SharedPtr<ISlide> slide : presentation2->get_Slides()){
	// Merge from source to destination
	presentation1->get_Slides()->AddClone(slide);
}

// Save the presentation
presentation1->Save(outputFilePath, SaveFormat::Potm);

```

## เกี่ยวกับ Aspose.Slides สำหรับ C++ API

 Aspose.Slides API สามารถใช้อ่าน เขียน จัดการ และแปลงเอกสาร Microsoft PowerPoint เป็น PDF, XPS, HTML, TIFF, ODP และรูปแบบอื่นๆ ได้ หนึ่งสามารถสร้างไฟล์ใหม่ตั้งแต่เริ่มต้นและบันทึกในรูปแบบที่รองรับที่เกี่ยวข้อง Aspose.Slides เป็น API แบบสแตนด์อโลนสำหรับการสร้าง แยกวิเคราะห์ หรือจัดการการนำเสนอ สไลด์ และองค์ประกอบ และไม่ขึ้นกับซอฟต์แวร์ใดๆ เช่น Microsoft หรือ OpenOffice

Files with POTM extension are Microsoft PowerPoint template files with support for Macros. POTM files are created with PowerPoint 2007 or above and contains default settings that can be used to create further presentation files. These settings can include styles, backgrounds, colour palette, fonts and defaults along with macros that consist of custom functions for doing particular task. They may also be opened by a previous version of PowerPoint with Open XML document support installed. POTM files can be opened in Microsoft PowerPoint for editing like any other PowerPoint file.

## รูปแบบการผสานที่รองรับอื่น ๆ

- [ODP](https://products.aspose.com/slides/th/cpp/merger/odp/) — รูปแบบการนำเสนอ OpenDocument
- [OTP](https://products.aspose.com/slides/th/cpp/merger/otp/) — รูปแบบมาตรฐานของ OpenDocument
- [POT](https://products.aspose.com/slides/th/cpp/merger/pot/) — ไฟล์เทมเพลต Microsoft PowerPoint
- [POTX](https://products.aspose.com/slides/th/cpp/merger/potx/) — การนำเสนอเทมเพลต Microsoft PowerPoint
- [PPS](https://products.aspose.com/slides/th/cpp/merger/pps/) — สไลด์โชว์ PowerPoint
- [PPSM](https://products.aspose.com/slides/th/cpp/merger/ppsm/) — สไลด์โชว์ที่เปิดใช้งานมาโคร
- [PPSX](https://products.aspose.com/slides/th/cpp/merger/ppsx/) — สไลด์โชว์ PowerPoint
- [PPT](https://products.aspose.com/slides/th/cpp/merger/ppt/) — Microsoft PowerPoint 97-2003
- [PPTM](https://products.aspose.com/slides/th/cpp/merger/pptm/) — ไฟล์นำเสนอที่เปิดใช้งานมาโคร
- [PPTX](https://products.aspose.com/slides/th/cpp/merger/pptx/) — เปิดรูปแบบการนำเสนอ XML
