We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How do you access MailMessage BillingInformation in VB.Net for a .msg file?

How do you access BillingInformation in VB.Net for a .msg file?
I have this code:
Dim msg As New Aspose.Email.Mail.MailMessage()
msg = Aspose.Email.Mail.MailMessage.Load(Email, Aspose.Email.Mail.MessageFormat.Msg)

But can't find any access to BillingInformation How do you access BillingInformation in VB.Net for a .msg file?
I have this code:
Dim msg As New Aspose.Email.Mail.MailMessage()
msg = Aspose.Email.Mail.MailMessage.Load(Email, Aspose.Email.Mail.MessageFormat.Msg)

But can't find any access to BillingInformation

Hi Stephen,


Could you please give a try to the following code which extracts billing information from MSG file and displays the result.

Dim msg2 As New MapiMessage()
Dim msg As MapiMessage = MapiMessage.FromFile(“D:\Aspose\Task.msg”)
Dim task As MapiTask = DirectCast(msg.ToMapiMessageItem(), MapiTask)

'Date Completed
Dim DateCompleted As DateTime = task.DateCompleted

'Total Work (Hours)
Dim EstimatedEffortHours As Integer = task.EstimatedEffort

'Actual Work
Dim ActualEffortHours As Integer = task.ActualEffort

'Mileage
Dim Mileage As String = msg.Properties(&H804B001FUI).GetString()

'Billing Information
Dim BillingInformation As String = msg.Properties(&H804C001FUI).GetString()

Please feel free to write us back if you have any other query in this regard.

How do I set and save BillingInformation?

Hi Stephen,


Could you please give a try to the following code which sets the billing information and then saves the message on disc?

Dim msg2 As New MapiMessage()
Dim msg As MapiMessage = MapiMessage.FromFile(“D:\Aspose\Task.msg”)
Dim task As MapiTask = DirectCast(msg.ToMapiMessageItem(), MapiTask)

'Date Completed
Dim DateCompleted As DateTime = task.DateCompleted

'Total Work (Hours)
Dim EstimatedEffortHours As Integer = task.EstimatedEffort

'Actual Work
Dim ActualEffortHours As Integer = task.ActualEffort

'Mileage
Dim Mileage As String = msg.Properties(&H804B001FUI).GetString()

'Get Billing Information
Dim BillingInformation As String = msg.Properties(&H804C001FUI).GetString()

'Set Billing Information
BillingInformation = “420$”

Dim prop As New MapiProperty(&H804C001FUI, System.Text.Encoding.Unicode.GetBytes(BillingInformation))
msg.SetProperty(prop)
msg.Save(“D:\Aspose\Task2.msg”)

Please feel free to write us back if you have any other query in this regard.

I note that you save it as a different file name. Is this on purpose?

Hi Stephen,


You may please save back the file on disc with same name as “Task.msg” as there is no specific requirement of different file name.

Please feel free to write us back if you have any query related to Aspose.Email.