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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save e-mail to *.msg on send 1

Status
Not open for further replies.

sciencer

Technical User
Jan 7, 2004
17
NL
Hi

I've got a userform with 3 textboxes and command_button

When I press the command_button

The fulling code will work:



VB:
--------------------------------------------------------------------------------
Private Sub CommandButton1_Click()
Set myOlApp = CreateObject("Outlook.Application")
Set myitem = myOlApp.CreateItem(olMailItem)
myitem.Subject = TextBox1.Text
myitem.To = TextBox2.Text
Filename = TextBox1.Text & textbox3.text
myitem.saves "c:\temp\" & Filename & ".msg" , olmsg
Unload Me
myitem.Display
End Sub
--------------------------------------------------------------------------------
How can i save this mail on the same name when is push the button send?

Greetings Raymond
 
Hello,

Put this code in ThisOutlookSession.

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
'Your code goes here - Item parameter is the mail item
End Sub

Good Luck!

Have a great day!

j2consulting@yahoo.com
 
Hello Sciencer,

I don't know how technical you are so if you need more explanation, please feel free to post again. I have to run for now. Good LucK!

Have a great day!

j2consulting@yahoo.com
 
Hello SBendBuckeye

Correct me if i'm wrong but

When I've clicked on het button the sub will end and as for as I know the value of my variable that I use for saveing my message will also be empty.

Where can i or how can i find what is that variable or what is the filename so I can save it on the same name?

Greetings Raymond

 
Hello Raymond,

I have to leave to take my daughter to O'Hare airport in Chicago. I'll try to get back later this evening. Sorry I don't have time to answer immediately.

Have a great day!

j2consulting@yahoo.com
 
Well just at first glance it looks like you would just need to set some global variables to hold that data.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top