PDA

View Full Version : [SOLVED:] Scheduling project in Outlook



pjbassdc
02-23-2015, 08:37 AM
Hi All,

I have been slowly working on a project to help solve inconsistencies in our service requisitions. Trying to keep this short, we have a group of individuals that request services from my department. Many times, the information arrives incomplete, therefore requiring followup. What I have managed so far is to work up a scheduling userform I would like them to utilize. From the userform, I would like to capture the input data and have it submit to my group's email in a format that would allow us, upon approval, to add it to our Outlook appointment calendar by way of a toolbar icon.

I have been looking around the web for a solution I can understand and use. I am still early on the learning curve with VBA. I have seen some information on sending captured data from Excel, but I need to keep this in the Outlook environment or the end user buy-in will not be good. I realize that I may be limiting myself by trying to stick with Outlook only. When the project is finished, it will be located in a network folder that the users will be able to access.

So, having the userform set the way I like, how do I start gathering the input data to send as an email?

If someone can tell me how to post the OTM file from Outlook, I will be happy to show you what I managed so far.

Thank you for any help you may be able to provide.

Patrick

skatonni
02-24-2015, 07:22 PM
Re: "having the userform set the way I like, how do I start gathering the input data to send as an email?"

Appears you want something like this


Private Sub CommandButton1_Click()

Dim objMail As Object
Dim ProblemType As string
Dim RequesterName As string
Dim OfficeNumber As string
Dim FreeformText As string

ProblemType = ListBox1.Value
RequesterName = Textbox1.Value
OfficeNumber = Textbox2.Value
FreeformText = Textbox3.Value

Set objMail = Application.CreateItem(0)

With objMail
.To = "helpdesk@company.com"
.Subject = "Service Request for: " & ProblemType
.Body = "Requester Name: " & RequesterName & vbcr & "Office Number: " & OfficeNumber
.Display
'.Send
End With

End Sub

pjbassdc
02-26-2015, 06:55 AM
Thank you for the reply Skatonni,

I kept pressing on and found a solution for what I was attempting to accomplish.

Here is the code that I am using. It is a bit different than what you provided, but I thank you for your effort.


Private Sub submitrequest_Click()

Dim outobj As Object
Dim email As Object
Dim msg As String
Dim sreceiver As String






sreceiver = "Email address here"


Set outobj = CreateObject("outlook.application")
Set email = outobj.CreateItem(0)


email.Subject = "Email subject"


msg = ""


msg = msg & "Request Type: " & Me.typecbo.Value & vbCrLf
msg = msg & "Surgeon: " & Me.surgeoncbo.Value & vbCrLf
msg = msg & "Patient: " & Me.nametxt.Value & vbCrLf
msg = msg & "MRN: " & Me.mrntxt.Value & vbCrLf
msg = msg & "Case Type: " & Me.Casetypetxt.Value & vbCrLf
msg = msg & "Levels or Area: " & Me.levelstxt.Value & vbCrLf
msg = msg & "Modalities Requested: " & ConcatSelected(Me.modalitylst) & vbCrLf
msg = msg & "EMG Requested: " & ConcatSelected(Me.EMGlst) & vbCrLf
msg = msg & "Other Requested: " & Me.othertxt.Value & vbCrLf & vbCrLf & vbCrLf
msg = msg & "Scheduled Date: " & Me.DTPicker1.Value & vbCrLf
msg = msg & "Start Time: " & Me.DTPicker2.Value & vbCrLf
msg = msg & "End Time: " & Me.DTPicker3.Value & vbCrLf
msg = msg & "Room Number: " & Me.ortxt.Value & vbCrLf & vbCrLf
msg = msg & "Insurance: " & Me.inscbo.Value & vbCrLf












email.Body = msg
email.To = sreceiver
email.Send


Set email = Nothing
Set outobj = Nothing
End Sub







Patrick