Dear All,
I used office 32-bit but our PC changed to 64-bit. I need your help and code is below. If you put additional code, it will be good. I appreciate your help in advance.
I used office 32-bit but our PC changed to 64-bit. I need your help and code is below. If you put additional code, it will be good. I appreciate your help in advance.
Code:
[TABLE="width: 117"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Private Declare Function ShellExecute Lib "shell32.dll" _[/TD]
[/TR]
[TR]
[TD]Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _[/TD]
[/TR]
[TR]
[TD]ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _[/TD]
[/TR]
[TR]
[TD]ByVal nShowCmd As Long) As Long[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Sub Khalid()[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]reqem = InputBox("zehmet olmasa Password giriniz")[/TD]
[/TR]
[TR]
[TD]If reqem = 1111 Then GoTo dogrusayi[/TD]
[/TR]
[TR]
[TD]MsgBox "Password Sehvdir:("[/TD]
[/TR]
[TR]
[TD]Exit Sub[/TD]
[/TR]
[TR]
[TD]dogrusayi:[/TD]
[/TR]
[TR]
[TD]MsgBox "Password dogrudur:)"[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD] Dim Email As String, Subj As String[/TD]
[/TR]
[TR]
[TD] Dim Msg As String, URL As String[/TD]
[/TR]
[TR]
[TD] Dim r As Integer, x As Double[/TD]
[/TR]
[TR]
[TD] For r = 2 To 15 'data in rows 6-8[/TD]
[/TR]
[TR]
[TD]' Get the email address[/TD]
[/TR]
[TR]
[TD] Email = Cells(r, 6)[/TD]
[/TR]
[TR]
[TD] [/TD]
[/TR]
[TR]
[TD]' Message subject[/TD]
[/TR]
[TR]
[TD] [/TD]
[/TR]
[TR]
[TD] [/TD]
[/TR]
[TR]
[TD] Subj = "2018 salary review"[/TD]
[/TR]
[TR]
[TD] [/TD]
[/TR]
[TR]
[TD] [/TD]
[/TR]
[TR]
[TD]' Compose the message[/TD]
[/TR]
[TR]
[TD] Msg = ""[/TD]
[/TR]
[TR]
[TD] Msg = Msg & "Dear " & Cells(r, 1) & "," & vbCrLf & vbCrLf[/TD]
[/TR]
[TR]
[TD] [/TD]
[/TR]
[TR]
[TD] Msg = Msg & "Following salary review for 2018 we are pleased to inform you that you are eligible for salary increase as outlined below:" & vbCrLf & vbCrLf[/TD]
[/TR]
[TR]
[TD] [/TD]
[/TR]
[TR]
[TD] Msg = Msg & "Current Gross Monthly Salary: " & "" & Cells(r, 2).Text & " " & "AZN Gross." & vbCrLf & vbCrLf[/TD]
[/TR]
[TR]
[TD] [/TD]
[/TR]
[TR]
[TD] Msg = Msg & "New Gross Monthly Salary: " & "" & Cells(r, 3).Text & " " & "AZN Gross." & vbCrLf & vbCrLf[/TD]
[/TR]
[TR]
[TD] [/TD]
[/TR]
[TR]
[TD] Msg = Msg & "Increase amount: " & "" & Cells(r, 4).Text & " " & "AZN Gross." & vbCrLf & vbCrLf[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD] Msg = Msg & "Effective Date: " & "" & Cells(r, 5).Text & " " & vbCrLf & vbCrLf[/TD]
[/TR]
[TR]
[TD] [/TD]
[/TR]
[TR]
[TD] Msg = Msg & "You will be contacted by HR representative within next week to provide you with the amendment to your employment contract as a formal confirmation of your salary increase. Please do not hesitate to ask should you have any questions." & vbCrLf & vbCrLf[/TD]
[/TR]
[TR]
[TD] [/TD]
[/TR]
[TR]
[TD] Msg = Msg & "Thanks for your contribution to the successful project delivery." & vbCrLf & vbCrLf[/TD]
[/TR]
[TR]
[TD] [/TD]
[/TR]
[TR]
[TD] Msg = Msg & "Your Sincerely" & vbCrLf[/TD]
[/TR]
[TR]
[TD] Msg = Msg & "XXX" & vbCrLf[/TD]
[/TR]
[TR]
[TD] [/TD]
[/TR]
[TR]
[TD] Msg = Msg & "HR & Manager"[/TD]
[/TR]
[TR]
[TD] [/TD]
[/TR]
[TR]
[TD]' Replace spaces with %20 (hex)[/TD]
[/TR]
[TR]
[TD] Subj = Application.WorksheetFunction.Substitute(Subj, " ", "%20")[/TD]
[/TR]
[TR]
[TD] Msg = Application.WorksheetFunction.Substitute(Msg, " ", "%20")[/TD]
[/TR]
[TR]
[TD] [/TD]
[/TR]
[TR]
[TD]' Replace carriage returns with %0D%0A (hex)[/TD]
[/TR]
[TR]
[TD] Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf, "%0D%0A")[/TD]
[/TR]
[TR]
[TD]' Create the URL[/TD]
[/TR]
[TR]
[TD] URL = "mailto:" & Email & "?subject=" & Subj & "&body=" & Msg[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]' Execute the URL (start the email client)[/TD]
[/TR]
[TR]
[TD] ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]' Wait two seconds before sending keystrokes[/TD]
[/TR]
[TR]
[TD] Application.Wait (Now + TimeValue("0:00:02"))[/TD]
[/TR]
[TR]
[TD] Application.SendKeys "%s"[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD] Next r[/TD]
[/TR]
[TR]
[TD]End Sub[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]