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

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

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



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

 ในการผสานไฟล์ PPT เราจะใช้
 [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

```

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

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

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

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

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

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

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

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

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

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

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

// 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::Ppt);

```

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

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

A file with PPT extension represents PowerPoint file that consists of a collection of slides for displaying as SlideShow. It specifies the Binary File Format used by Microsoft PowerPoint 97-2003. A PPT file can contain several different types of information such as text, bulleted points, images, multimedia and other embedded OLE objects. Microsoft came up with newer file format for PowerPoint, known as PPTX, from 2007 onwards that is based on Office OpenXML and is different from this binary file format. Several other application programs such as OpenOffice Impress and Apple Keynote can also create PPT files.

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

- [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
- [POTM](https://products.aspose.com/slides/th/cpp/merger/potm/) — ไฟล์เทมเพลต 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
- [PPTM](https://products.aspose.com/slides/th/cpp/merger/pptm/) — ไฟล์นำเสนอที่เปิดใช้งานมาโคร
- [PPTX](https://products.aspose.com/slides/th/cpp/merger/pptx/) — เปิดรูปแบบการนำเสนอ XML
