Hi
Hi Cornelius,
MapiTask task = (MapiTask)msg.ToMapiMessageItem();
//Date Completed
DateTime DateCompleted = task.DateCompleted;
//Total Work (Hours)
int EstimatedEffortHours = task.EstimatedEffort;
//Actual Work
int ActualEffortHours = task.ActualEffort;
//Mileage
string Mileage = msg.Properties[2152398879].GetString();
//Billing Information
string BillingInformation = msg.Properties[2152464415].GetString();
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,
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
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()
How do I set BillingInformation value?
Hi Stephen,
Dim msg As MapiMessage = MapiMessage.FromFile(“D:\Aspose\Task.msg”)
Dim task As MapiTask = DirectCast(msg.ToMapiMessageItem(), MapiTask)
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”)
This does not appear to work for me. See my code below:
Dim msg As Aspose.Email.Outlook.MapiMessage = Aspose.Email.Outlook.MapiMessage.FromFile(txtCorrespondenceLoc.Text)
Dim BillInfo As String = "" + txtCorrespondenceLoc.Text + "True"
If Not String.IsNullOrEmpty(txtCorrPropertyID.Text) Then
BillInfo = BillInfo + “” + txtCorrPropertyID.Text + “”
End If
If Not String.IsNullOrEmpty(txtCorrClientID.Text) Then
BillInfo = BillInfo + “” + txtCorrClientID.Text + “”
End If
If Not String.IsNullOrEmpty(txtCorrEnquiryID.Text) Then
BillInfo = BillInfo + “” + txtCorrEnquiryID.Text + “”
End If
Dim prop As New Aspose.Email.Outlook.MapiProperty(&H804C001FUI, System.Text.Encoding.Unicode.GetBytes(BillInfo))
msg.SetProperty(prop)
Dim TempFile As String = System.IO.Path.GetTempFileName + “.msg”
msg.Save(TempFile)
msg.Dispose()
Process.Start(TempFile)
Also, all the internet header information is being lost and I need to keep it.
I think fixed the Internet Header problem by changing:
FromFile(txtCorrespondenceLoc.Text)
to
FromMailMessage(txtCorrespondenceLoc.Text)
But still no BillingInformation
sswavley:This does not appear to work for me. See my code below:
Could you please explain what problem you are facing with the code sample that I provided you earlier? I have checked the output file Task2.msg and the billing information is available in the output file as you can see in the attached screenshot. Please provide us more information about the problem you are facing in this regard (with the help of screenshots if possible) so that we can assist you further.