Consulting

Results 1 to 3 of 3

Thread: Scheduling project in Outlook

  1. #1
    VBAX Newbie
    Joined
    Aug 2013
    Posts
    2
    Location

    Scheduling project in Outlook

    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

  2. #2
    VBAX Mentor skatonni's Avatar
    Joined
    Jun 2006
    Posts
    347
    Location
    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
    To debug, mouse-click anywhere in the code. Press F8 repeatedly to step through the code. http://www.cpearson.com/excel/DebuggingVBA.aspx

    If your problem has been solved in your thread, mark the thread "Solved" by going to the "Thread Tools" dropdown at the top of the thread. You might also consider rating the thread by going to the "Rate Thread" dropdown.

  3. #3
    VBAX Newbie
    Joined
    Aug 2013
    Posts
    2
    Location
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •