I am trying to programatically launch Outlook 2007 from a Visual Basic program. The code works fine on Windows Vista and Windows 7, however, I get a "error 0x80004004" on Windows XP. Any thoughts?
Microsoft DevelopmentOutlookVisual Basic.NET.NET ProgrammingVisual Basic Classic
Last Comment
Nasir Razzaq
8/22/2022 - Mon
gery128
can you paste some code here? then people will be able to help you.
Joe Kaminski
ASKER
Here is the code:
Private Sub btnSendEmail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSendEmail.Click
Dim oApp As Outlook._Application
Dim strMemosReleased As String
oApp = New Outlook.Application()
Dim oMsg As Outlook._MailItem
oMsg = oApp.CreateItem(Outlook.OlItemType.olMailItem)
oMsg.To = "Person1@Company.com"
oMsg.CC = "Person2@Company.com"
oMsg.Subject = "Customer Service Shipping Release, PO " & dgvCustomerOrders.CurrentRow.Cells("dgvCustomerOrders_PurchaseOrderID").Value
oMsg.Body = "Ship Date: " & vbCr
oMsg.Body += "Credit Approved?: " & vbCr
oMsg.Body += "Shipping Company: " & vbCr
oMsg.Body += "Freight Costs: " & vbCr
oMsg.Body += "Pattern:" & vbTab & vbTab & dgvCustomerOrders.CurrentRow.Cells("dgvCustomerOrders_PatternDescription").Value & vbCr
oMsg.Body += "Yardage:" & vbTab & vbTab & txtMemoYardage.Text & vbCr
strMemosReleased = Nothing
For Each dgvrTemporary As DataGridViewRow In dgvMemos.Rows
If dgvrTemporary.Cells("dgvMemos_Selection").EditedFormattedValue = False Then Continue For
strMemosReleased += dgvrTemporary.Cells("dgvMemos_Memo").Value & " "
Next
oMsg.Body += "Memos:" & vbTab & vbTab & strMemosReleased
oMsg.Body += "Shipping Instructions:" & vbTab & vbCr
oMsg.Display()
oApp = Nothing
oMsg = Nothing
End Sub
Nasir Razzaq
So the problem is only on XP? Is the Office version same on all?