![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi,
I am trying to send a document using vb.net and outlook and words, The type of file i would like to send are (rtf, doc, txt) as the message body in the outlook message. Any one with experince in this area the help will be surely appreciated. I have added the code below i get some type of hresult type error when i run this. Public Sub SendDocMsg(ByVal subjectp As String, ByVal pEmail As String, _ ByVal fileDirLocation As String) recipient = pEmail subject = subjectp Dim oLApp As Object Dim oItem As Object Dim oDoc As Object On Error GoTo errorHandler 'Create a new mailitem ' oOutlook = New Outlook.Application oLApp = CreateObject("Outlook.Application") oItem = oLApp.CreateItem(0) oDoc = CreateObject("Word.Application") oDoc.Visible = True oDoc.Documents.Open(fileDirLocation) With oItem 'Set the recipient for the new email .To = mRecipient 'Set the recipient for a copy '.CC = " 'Set the subject .Subject = mSubject 'The content of the document is used as the body for the email .Body = oDoc.ActiveDocument.Content .Send() End With errorHandler: MsgBox(Err.Number & " " & Err.Description) 'Clean up oItem = Nothing oLApp = Nothing oDoc = Nothing End Sub ' SendMsg -- Digit Solverâ„¢ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sending email via .NET | msnews.microsoft.com | Outlook - General Queries | 7 | March 18th 06 06:12 PM |
Outlook won't display body of plain text message | Mike | Outlook - General Queries | 1 | March 14th 06 06:54 PM |
Doc Message Class and MS Server 2003/OL2003 | Stimpy | Outlook - Using Forms | 1 | March 13th 06 12:21 AM |
need to send rtf format using smtp and vb6 or vb.net | aharbour | Outlook and VBA | 1 | February 21st 06 01:56 PM |
Embed an image in rtf doc (appointment or email body) | Sue Mosher [MVP-Outlook] | Outlook and VBA | 0 | February 1st 06 04:20 PM |