PersonalStorage.MergeWith
Contents
[
Hide
]MergeWith(string[])
Merges one or more other PST files into this PST.
public void MergeWith(string[] sourceFileNames)
| Parameter | Type | Description |
|---|---|---|
| sourceFileNames | String[] | The paths of the PST files to merge. |
Exceptions
| exception | condition |
|---|---|
| ArgumentNullException | sourceFileNames is null. |
| ArgumentException | An element of sourceFileNames is null or empty. |
Remarks
StorageProcessing is raised before each source is merged, and StorageProcessed after it.
Examples
This example merges two PST files into a third one and reports each file as it is merged.
[C#]
using (var pst = PersonalStorage.FromFile("merged.pst"))
{
pst.StorageProcessing += (sender, e) => Console.WriteLine($"Merging {e.FileName}");
// Add the contents of the other files to merged.pst
pst.MergeWith(new[] { "2024.pst", "2025.pst" });
}
[Visual Basic]
Using pst As PersonalStorage = PersonalStorage.FromFile("merged.pst")
AddHandler pst.StorageProcessing, Sub(sender, e) Console.WriteLine($"Merging {e.FileName}")
' Add the contents of the other files to merged.pst
pst.MergeWith(New String() {"2024.pst", "2025.pst"})
End Using
See Also
- class PersonalStorage
- namespace Aspose.Email.Storage.Pst
- assembly Aspose.Email
MergeWith(Stream[])
Merges one or more other PST streams into this PST.
public void MergeWith(Stream[] sourceStreams)
| Parameter | Type | Description |
|---|---|---|
| sourceStreams | Stream[] | The streams with the PST data to merge. |
Exceptions
| exception | condition |
|---|---|
| ArgumentNullException | sourceStreams is null. |
| ArgumentException | An element of sourceStreams is null. |
Remarks
StorageProcessing is raised before each source is merged, and StorageProcessed after it.
See Also
- class PersonalStorage
- namespace Aspose.Email.Storage.Pst
- assembly Aspose.Email