Extract OST Metadata via C++
Build your own C++ apps to add, edit, remove or extract metadata from OST files using server-side APIs.
How to Get OST Metadata Using C++
In order to extract OST metadata, we’ll use
API which is a feature-rich, powerful and easy to use document metadata extraction API for C++ platform. You can download its latest version directly, just open
package manager, search for Aspose.Email.Cpp and install. You may also use the following command from the Package Manager Console.
Command
PM> Install-Package Aspose.Email.Cpp
Steps to Extract Metadata of OST via C++
Get the type of the message while using GetProperties which in turn allows getting all metadata information via a simple loop.
- Load the OST file via MapiMessage::FromFile
- Get properties collection using get_Properties()
- Get the respective property using idx_get
System Requirements
Aspose.Email for C++ supports on all major platforms and Operating Systems. Please make sure that you have the following prerequisites.
- Microsoft Windows or a compatible OS with C++ Runtime Environment for Windows 32 bit, Windows 64 bit and Linux 64 bit.
- Aspose.Email for C++ DLL referenced in your project.
Extract Metadata of OST - C++
// Load from file
System::SharedPtr<MapiMessage> ost = MapiMessage::FromFile(dataDir + L"message.ost");
System::String subject;
// Access the MapiPropertyTag.PR_SUBJECT property
System::SharedPtr<MapiProperty> prop = ost->get_Properties()->idx_get(MapiPropertyTag::PR_SUBJECT);
// If the property is not found, check the MapiPropertyTag.PR_SUBJECT_W (which is a // Unicode peer of the MapiPropertyTag.PR_SUBJECT)
if (prop == nullptr){
prop = ost->get_Properties()->idx_get(MapiPropertyTag::PR_SUBJECT_W);
}
// Cannot found
if (prop == nullptr){
System::Console::WriteLine(L"No property found!");
return;
}
// Get the property data as string
subject = prop->GetString();
System::Console::WriteLine(System::String(L"Subject:") + subject);
// Read internet code page property
prop = msg->get_Properties()->idx_get(MapiPropertyTag::PR_INTERNET_CPID);
if (prop != nullptr){
System::Console::WriteLine(System::String(L"CodePage:") + prop->GetLong());
}
About Aspose.Email for C++ API
Aspose.Email is a Microsoft Outlook and Thunderbird formats parsing solution. One can easily create, manipulate, convert email and storage formats such as MSG, EMLX, EML and MHT. Handling of email attachments, customization of message headers and implementation of different network protocols like POP3, IMAP & SMTP to send & receive emails is much easier. Its a standalone API and does not require Microsoft Outlook or any other software installation.Extract Metadata of OST via Online App
View & edit Metadata to OST documents by using our Live Demos with following benefits.
OST What is OST File Format
OST or Offline Storage Files represent user's mailbox data in offline mode on local machine upon registration with Exchange Server using Microsoft Outlook. It is automatically created on the first use of Microsoft Outlook upon connectivity with server. Once the file is created, the data is synchronized with the email server so that it is available offline as well in case of disconnectivity from email server. OST files can user mailbox items such as emails, contacts, calendar information, notes, tasks and other similar data. Users can create emails and other data items in OST file even in the absence of connection to the server, but these will not be synchronized with the server. Once the connection is established, the local file is synchronized with the server again so that both the server and the local copy are at the same level of information.
Read More