![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 103
|
HELP!!!!
i have to hand a proect in in an hour and i need to know if anyone can anotate the following code for me or convert it into english that i can understand! Private Declare Function ShellExecute Lib "shell32.dll" _ Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _ ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _ ByVal nShowCmd As Long) As Long Sub WillWages() Dim Email As String, Subj As String Dim Msg As String, URL As String, x As Double Email = "lobbwill@hotmail.com" Subj = "Wage Details" Msg = "" Msg = Msg & "Dear Will, " & vbCrLf & vbCrLf Msg = Msg & "Please check that the hours worked in and out of school shown below, are correct and that the total is also correct " Msg = Msg & Range("C7").Text & "" & Range("C7").Text & "" & vbCrLf & vbCrLf & Range("F11").Text & " - " & Range("F13").Text & "" & vbCrLf & vbCrLf & Range("G11").Text & " - " & Range("G13").Text & "" & vbCrLf & vbCrLf & Range("H11").Text & " - " & Range("H13").Text & "" & vbCrLf & vbCrLf Msg = Msg & "Thank You " & vbCrLf Msg = Msg & "Klik. " Subj = Application.WorksheetFunction.Substitute(Subj, " ", "%20") Msg = Application.WorksheetFunction.Substitute(Msg, " ", "%20") Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf, "%0D%0A") URL = "mailto:" & Email & "?subject=" & Subj & "&body=" & Msg ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus Application.Wait (Now + TimeValue("0:00:02")) Application.SendKeys "%s" End Sub Thank you soooooo much Will |
|
|
|
|
|
#2 | |
|
Board Regular
Join Date: Feb 2002
Location: Houston,Texas
Posts: 418
|
Quote:
|
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Posts: 103
|
i think thats pretty harsh mate.
this code does not have to be done by me, as i have said that i have had help from this site, so if anyone has any constructive comments could they please help me? Thanks Will |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
|
There's not much to explain, to be honest. You create a hee-yuge assed string with all those "Msg=" statements then you use some sort of API call to start some app and then you send ALT+S shortcut to your mysterious APP (which I think is Outlook or Outlook Express since you're using an ALT+S shortcut.)
Oh yeah and your MSg is the body of your email. As I said, not much to explain. Steve: Good idea, I think we should mention exhorbitant pay raises. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|