Showing posts with label Intrenet. Show all posts
Showing posts with label Intrenet. Show all posts

Saturday, October 8, 2011

How to mail through VBA from Outlook

With help this macro code you can mail easily from outlook in just a single click....


Sub Mail ()
ESubject = "Mail Subject"
SendTo = "email-id"
CCTo = "email-id"
'Ebody = "TEST MAIL"
Ebody = "Mail Body"
newfilename = " The complete Path of file that to mail"
Set App = CreateObject("Outlook.Application")
Set Itm = App.CreateItem(0)
With Itm
.Subject = ESubject
.To = SendTo
.CC = CCTo
.Body = Ebody
.Attachments.Add newfilename
.send
End With
Set App = Nothing
Set Itm = Nothin
End Sub ()

Use this line to close your webpage or internet explorer that you opened

Use this line to close your webpage or internet explorer that you opened through previous code

Type this...

ie.Quit


This for open


Sub VisitWebsite()
Dim ie As Object
Set ie = CreateObject("INTERNETEXPLORER.APPLICATION")
ie.NAVIGATE "http://excelmacrosnvba.blogspot.com"
ie.Visible = True
While ie.busy
DoEvents
Wend
End Sub

** Change the url..

How to Open Web page and Nevigate through VBA

Here the code that can help you to easily open your website through VBA..


Sub VisitWebsite()
Dim ie As Object
Set ie = CreateObject("INTERNETEXPLORER.APPLICATION")
ie.NAVIGATE "http://excelmacrosnvba.blogspot.com"
ie.Visible = True
While ie.busy
DoEvents
Wend
End Sub

** Change the url..