Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
DoctorPolidori
Contributor III
Contributor III

Subroutine in an Expression

I want to send an email whe pressing a button building the email body using a subroutine similar to this one I wrte in Visual Basic

VISUAL BASIC SAMPLE CODE
Sub CreateMailtoText() 
dim manager, employee, skill, hours_perweek, project_name, start_week, end_week, mailto_string , your_name as String
manager = "peter.smith@company.com"
employee = "carla.petterson@company.com"
skill = "Excel"
project_name = "'Jobb åt folket 2024'"
hours_perweek = "4"
start_week = "w44 2023"
end_week = "w48 2023"
your_name = "Calle Requester"

mailto_string = "Hi " _
& UCase(Mid(manager,1,1)) & Mid(manager,2,InStr(manager,".")-2) & "!" & vbCrLf & vbCrLf _
& "I hope you are doing well." & vbCrLf _
& "I believe you have a resource named " & employee _
& " with top " & skill & " skills" & vbCrLf _
& "and I wonder if she/he could be available to help on project " & project_name _
& hours_perweek & "/week between week " & start_week & vbCrLf _
& "and " & end_week & vbCrLf & vbCrLf _
& "Thanks in advance" & Chr(10) & vbCrLf _
& your_name

Console.WriteLine(mailto_string)

End Sub

Labels (1)
0 Replies