Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generate Reply Email 1

Status
Not open for further replies.

air1access

Technical User
Jan 27, 2008
123
US
Hopefully this is the right area to post my request...

I have a form with a cmd button.
The cmd button generates a new email message with the a text box contents as the body of the email.
Below is what I'm working with..

What I am wanting to do is instead of generating a new email - I want it to be a "reply" email.
I have the EntryID of the email I would be replying too - the d/base I have connects to the inbox and imports MailItem data fields..

Any suggestions or examples would be much appreciated..!! Thanks in advance..!!
air1access

Dim MyApp As Outlook.Application
Dim MyItem As Outlook.MailItem
Dim strBody As String

Set MyApp = CreateObject("Outlook.Application")
Set MyItem = MyApp.CreateItem(olMailItem)

strBody = strBody & "<P><FONT face=Arial size=3>" & Me.txtResolution & ""

With MyItem
.BodyFormat = olFormatHTML
.To = ""
.Subject = Me.txtSubject
.HTMLBody = strBody
.Display
End With
 
I have other MailItem data elements if that will help... Such as StoreID, ConversationID & Index, etc...
Any help would be much appreciated..!!! :)
 
Ok - I got it to generate a "reply" email using the entryID...
The email is generated and shows all the contents of the email trail in the body - just like it does when you click the "Reply" button in Outlook.

I'm trying to get the contents of a textbox on my form to be the response comments in this "reply" email...
Whenever I implement that - it clears out the entire contents of the email - but it does show my textbox comments...
I'm using a generic sentence to test my theories for now - not an acutall text box.... Just a heads up...

Here is what I'm working with now...
Any suggestions..?

Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim strBody As String

Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)

'Set App = CreateObject("Outlook.Application")
Set NS = olApp.GetNamespace("MAPI")
NS.Logon
Set olMail = NS.GetItemFromID("00000000CFBF21B205AACE44AB2BE90F79CCC6EB0700C6D9AC85D4020348B003739AE22DB916000000763B400000C6D9AC85D4020348B003739AE22DB9160000007D1DD20000")

strBody = strBody & "<P><FONT face=Arial size=3>Each of you listed above has been assigned eMails from the NY SBE eMail Mailbox. Please direct your attention to your assigned eMail items as soon as possible." & Chr(13) & Chr(13)

With olMail.Reply
.HTMLBody = strBody
.Display

End With
 
Any suggestions or examples? Do I need to move this post to a different area..?
 
What about this ?
.HTMLBody = strBody & .HTMLBody

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV - you are my hero..!!
Thank you so much..!!!

That is what I needed. I searched, tested, tried all kinds of different things and I'm feeling silly because it ended up being a simple line of code.. Ha..!!

Thanks again..!
You rock..!!

air1access
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top