# C++を介してPPTファイルをマージする

> Windows 32ビット、Windows 64ビット、およびLinux64ビット用のC++ランタイム環境でPPTドキュメントを組み合わせるためのC++サンプルコード。

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



## C++を使用してPPTファイルをマージする方法

 PPTファイルをマージするために、
 [Aspose.Slides for C ++](https://products.aspose.com/slides/cpp)
 機能が豊富で強力で使いやすいC++プラットフォーム用のドキュメントマージAPIであるAPI。最新バージョンを直接ダウンロードできます。開くだけです。
 [NuGet](https://www.nuget.org/packages/aspose.slides)
 パッケージマネージャー、検索
 ** Aspose.Slides.Cpp **
 とインストールします。パッケージマネージャーコンソールから次のコマンドを使用することもできます。

### 指示

```cs

PM> Install-Package Aspose.Slides.Cpp

```

## C++でPPTファイルをマージする手順

[Aspose.Slides for C ++](https://products.aspose.com/slides/cpp)APIとマージおよび連結する基本的なドキュメントは、わずか数行のコードで実行できます。

両方のPPTファイルをロードします。

get \ _Slides（）メソッドを使用して、各スライドを反復処理します。

AddClone関数を使用して、目的のファイルとマージします。

Save（）メソッドを使用して、指定したパスに保存します

## システム要求

 Aspose.Slides for C ++は、すべての主要なプラットフォームとオペレーティングシステムでサポートされています。次の前提条件があることを確認してください。

-MicrosoftWindowsまたはWindows32ビット、Windows 64ビット、Linux64ビット用のC++ランタイム環境と互換性のあるOS。
-プロジェクトで参照されているC++DLLのAspose.Slides。

### 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 for 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/cpp/merger/odp/) — OpenDocumentプレゼンテーション形式
- [OTP](https://products.aspose.com/slides/cpp/merger/otp/) — OpenDocument標準フォーマット
- [POT](https://products.aspose.com/slides/cpp/merger/pot/) — MicrosoftPowerPointテンプレートファイル
- [POTM](https://products.aspose.com/slides/cpp/merger/potm/) — MicrosoftPowerPointテンプレートファイル
- [POTX](https://products.aspose.com/slides/cpp/merger/potx/) — MicrosoftPowerPointテンプレートプレゼンテーション
- [PPS](https://products.aspose.com/slides/cpp/merger/pps/) — PowerPointのスライドショー
- [PPSM](https://products.aspose.com/slides/cpp/merger/ppsm/) — マクロ対応のスライドショー
- [PPSX](https://products.aspose.com/slides/cpp/merger/ppsx/) — PowerPointのスライドショー
- [PPTM](https://products.aspose.com/slides/cpp/merger/pptm/) — マクロ対応のプレゼンテーションファイル
- [PPTX](https://products.aspose.com/slides/cpp/merger/pptx/) — XMLプレゼンテーション形式を開く
