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

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

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



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

 PPTMファイルをマージするために、
 [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++でPPTMファイルをマージする手順

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

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

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

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

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

## システム要求

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

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

### PPTMファイルのマージ-C++

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

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

```

## Aspose.Slides for C++APIについて

 Aspose.Slides APIを使用して、Microsoft PowerPointドキュメントの読み取り、書き込み、操作、およびPDF、XPS、HTML、TIFF、ODP、その他のさまざまな形式への変換を行うことができます。新しいファイルを最初から作成し、サポートされている関連する形式で保存できます。 Aspose.Slidesは、プレゼンテーション、スライド、要素を作成、解析、または操作するためのスタンドアロンAPIであり、MicrosoftやOpenOfficeなどのソフトウェアに依存しません。

Files with PPTM extension are Macro-enabled Presentation files that are created with Microsoft PowerPoint 2007 or higher versions. They are similar to PPTX files with the difference that the lateral can't execute macros though they can contain macros. PPTM files can be edited by opening them in Microsoft PowerPoint and updating the contents. Another similar format is PPSM but it is read-only by default and starts the slideshow when opened. PPTM, like PPTX, contains slides for different presentation elements like text, images, videos, graphs and other related material.

## その他のサポートされているマージ形式

- [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のスライドショー
- [PPT](https://products.aspose.com/slides/cpp/merger/ppt/) — Microsoft PowerPoint 97-2003
- [PPTX](https://products.aspose.com/slides/cpp/merger/pptx/) — XMLプレゼンテーション形式を開く
