Alpha DevCon 2018
Page 2 of 2 FirstFirst 12
Results 31 to 51 of 51

Thread: Outlook Calendar and Tasks

  1. #31
    Member
    Real Name
    david
    Join Date
    Jan 2013
    Posts
    17

    Default Re: Outlook Calendar and Tasks

    this is the code im using and the main table is called customer and the child table is appointments with the linked field of Customer_ID


    Sorry in advance for the amount of fields :-P


    dim objOutlook as P


    constant olAppointmentItem = 1

    objOutlook = ole.GetObject("","Outlook.Application")

    objAppointment = objOutlook.CreateItem(olAppointmentItem)


    objAppointment.Start = DATE_TUNING_REQUESTED.value '

    objAppointment.AllDayEvent = .T.
    objAppointment.Subject = CUSTOMER_ID.value + " " + TITLE.text + " " + NAME.text + " " + SURNAME0.text + " C.K"'
    objAppointment.Body = CUSTOMER_ID.value + " " + TITLE.text + " " + NAME.text + " " + SURNAME0.text + crlf(1) + " Mobile Numbers= "+ MOBILE.VALUE +crlf(1) +" Phone Numbers= "+ PHONE.VALUE +crlf(1) + ADDRESS.TEXT +crlf(1)+ ADDRESS_2.TEXT +crlf(1)+ TOWN.TEXT+crlf(1)+COUNTY.TEXT +crlf(1)+POST_CODE.TEXT + " AREA = " + AREA.TEXT +crlf(2)+ " E-MAIL = " + EMAIL_ADDRESS.TEXT + crlf(2)+ "Prospect = " + ACTIVE_PASSIVE.text + " Date of enquiry = " + DATE_OF_ENQUIRY.VALUE +crlf(2)+"Date last tuned " + Field4.value + " Priority Customer = " + Field2.value +" Installment Customer = " + INSTALLMENT.value +crlf(1)+ "Piano For Sale = " + SUPPLIED_PIANO.value + " Level = "+ PIANO_OFFERS_ACTIVE_PASSIVE.VALUE + crlf(3)+ "NOTES" +crlf(2)+ Notes.value + crlf(3) + "TS_______ INV________ Paid_________ Unpaid________ Last Charge___________" + crlf(2) + "Updated Notes Below" + crlf(2)'
    objAppointment.Location = PHONE.value'
    objAppointment.ReminderMinutesBeforeStart = 15
    objAppointment.ReminderSet = .T.

    objAppointment.Save()


    ui_msg_box("Confirmation","Appointment Booked" )

  2. #32
    Member
    Real Name
    david
    Join Date
    Jan 2013
    Posts
    17

    Default Re: Outlook Calendar and Tasks

    Sorry for the previous code i have now refined it and noted what i want happening

    i am working on form from a single table not a set aswell

    dim objOutlook as P


    constant olAppointmentItem = 1

    objOutlook = ole.GetObject("","Outlook.Application")

    objAppointment = objOutlook.CreateItem(olAppointmentItem)


    objAppointment.Start = DATE_OF_APPOINMENT_.value '

    objAppointment.AllDayEvent = .T.
    objAppointment.Subject = CUSTOMER_ID_.value + " " + NAME.text + " " + SURNAME.text + " " + TYPE.VALUE + " " + TIME.VALUE + " " + STAGE.VALUE
    objAppointment.Body = CUSTOMER_ID_.value + " " + NAME.text + " " + SURNAME.text + crlf(1) + " Mobile Numbers= "+ CONTACT_NUMBER1.VALUE +crlf(1) +" Phone Numbers= "+ CONTACT_NUMBER_2.VALUE +crlf(1) + ADDRESS.TEXT +crlf(1)+ ADDRESS2.TEXT +crlf(1)+ TOWN.TEXT+crlf(1)+COUNTY.TEXT +crlf(1)+POSTCODE.TEXT + " AREA = " + AREA.TEXT +crlf(2)+ " E-MAIL = " + EMAIL_ADDRESS_.TEXT + crlf(2) + crlf(3)+ "NOTES" +crlf(2)+ Notes_.value + crlf(3) + "TS_______ INV________ Paid_________ Unpaid________ Last Charge___________" + crlf(2) + "previous jobs below " + crlf(2)`

    `in the body i want to now be able to import all the previous records in the current table with the same customer ID if feild - CUSTOMER_ID_ = "1" all records with customer id is 1 -- so this code puts this appoinment from the form into calender i want the perform a fetch and fetch all records from my table into this body of appoinmnet one after the other but just the date of the appoinment and type and notes fields any ideas help would be much apprectaiated matching the same customer id

    objAppointment.Location = CONTACT_NUMBER1.value + " " + POSTCODE.TEXT '
    objAppointment.ReminderMinutesBeforeStart = 15
    objAppointment.ReminderSet = .T.

    objAppointment.Save()


    ui_msg_box("Confirmation","Appointment Booked" )

  3. #33
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,945

    Default Re: Outlook Calendar and Tasks

    If customer_id is character
    recs = parentform.QueryRun("customer_id = "+quote(customer_id.value))
    if recs > 0
    parentform.Fetch_First()
    'your present code here
    for qx = 1 to recs -1
    parentform.Fetch_next()
    'your present code here, again
    next
    end if

    If customer_id is numeric
    recs = parentform.QueryRun("customer_id = "+customer_id.value)
    if recs > 0
    parentform.Fetch_First()
    'your present code here
    for qx = 1 to recs -1
    parentform.Fetch_next()
    'your present code here, again
    next
    end if
    Last edited by Stan Mathews; 03-12-2014 at 09:46 AM.
    There can be only one.

  4. #34
    Member
    Real Name
    david
    Join Date
    Jan 2013
    Posts
    17

    Default Re: Outlook Calendar and Tasks

    sorry to be a pain but im unable to figure out this code how do i get it to repeat the value in the appoinmnet.body = for each record

    also could u meesage me you email to me as would like to send a few peenys to you via paypal as a thank you for the codding once i get it working lol bvut still thanks

  5. #35
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,945

    Default Re: Outlook Calendar and Tasks

    If customer_id is numeric

    recs = parentform.QueryRun("customer_id = "+customer_id.value) 'get a count of the records with the same customer_id as the record visible on the form
    if recs > 0 ' if the count is greater than zero
    parentform.Fetch_First() 'make sure we're on the first record of the customer_id
    'your present code here 'writes the values from the first record to the outlook calendar
    for qx = 1 to recs -1 'loop to process the rest of the records for the current customer (total count - 1 for the first record)
    parentform.Fetch_next() 'go to the next record with the same id
    'your present code here, again 'writes the values from the next record to the outlook calendar
    next 'loop back if more records
    end if
    There can be only one.

  6. #36
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,017

    Default Re: Outlook Calendar and Tasks

    David,

    One record sample
    Code:
    dim objOutlook as P
    
    objOutlook = ole.create("Outlook.Application")
    objAppointment = objOutlook.createitem(olAppointmentItem)
    
    'Find the records from Current Form or get it from Table with filter
    'Set the current form's value into VARIABLE
    vStartDate = parentfor:start_date.value
    vDuration =  parentfor:Duration.value
    vSubject = ....
    ...
    ...  
    'repeating as you need
    
    objAppointment.Start = vStartDate           <--- your Variable NAME
    objAppointment.Duration = vDuration
    objAppointment.Subject = vSubject
    objAppointment.Body = "Test Body "          <-- I think it is for message box
    objAppointment.Location = "44/2039"
    objAppointment.ReminderMinutesBeforeStart = 15
    objAppointment.ReminderSet = .t.
    
    objAppointment.Save()
    
    'that all you need

    many - repeating records and using Read and get the records from your_table
    Code:
    dim objOutlook as P
    objOutlook = ole.create("Outlook.Application")
    objAppointment = objOutlook.createitem(olAppointmentItem)
    
    'Read and get the records from your_table
    'Credit to Stan
    tbl = table.current(#)  '.or <tbl>.get() 
    query.filter ="Some filter here "
    query.order ="Your order expression "
    qry = tbl.query_create("n",query.filter )     <== find the records from table
    tbl.fetch_first()
    while .not. tbl.fetch_eof()                       <== loop code, Repeating until reach end of the found records
    
    'your present code goes here objAppointment.Start = tbl.start_date <--- your table's Field NAME objAppointment.Duration = tbl.Duration objAppointment.Subject = tbl.subject objAppointment.Body = tbl.your_message_field <-- I think it is for message box objAppointment.Location = "44/2039" objAppointment.ReminderMinutesBeforeStart = 15 objAppointment.ReminderSet = .t. objAppointmen
    t.Save() tbl.fetch_next() end while
    David, I could be wrong but just want to show you how to do. Try this, write the repeating(loop) code without "outlook_ole" and run it as test.
    See the previous Stan's comment.

    Code:
    ' a Button ---> OnPush event
    tbl = table.get(your_table_name)
    query.filter ="Customer_Id="+quote(vCustId)   'my sample
    query.order =""
    query.options ="N"
    qry = tbl.query_create()
    rcd = qry.records_get()
    	If rcd = 0 then
    	    msg("not found ")
                qry.drop()
            end if
    
    	If rcd > 0 then
    tbl.fetch_first()
    while .not. tbl.fetch_eof()
    'your present code goes here
    	    vCustNm = alltrim(tbl.Name)
                msg("Found ","for "+vCustNm)
                qry.drop()
    tbl.fetch_next()
    end while
            end if

  7. #37
    Member
    Real Name
    david
    Join Date
    Jan 2013
    Posts
    17

    Default Re: Outlook Calendar and Tasks

    Quote Originally Posted by Stan Mathews View Post
    If customer_id is numeric

    recs = parentform.QueryRun("customer_id = "+customer_id.value) 'get a count of the records with the same customer_id as the record visible on the form
    if recs > 0 ' if the count is greater than zero
    parentform.Fetch_First() 'make sure we're on the first record of the customer_id
    'your present code here 'writes the values from the first record to the outlook calendar
    for qx = 1 to recs -1 'loop to process the rest of the records for the current customer (total count - 1 for the first record)
    parentform.Fetch_next() 'go to the next record with the same id
    'your present code here, again 'writes the values from the next record to the outlook calendar
    next 'loop back if more records
    end if


    HERE IS WHAT I PUT TOGETHER



    dim objOutlook as P


    constant olAppointmentItem = 1

    objOutlook = ole.GetObject("","Outlook.Application")

    objAppointment = objOutlook.CreateItem(olAppointmentItem)


    objAppointment.Start = DATE_OF_APPOITNMENT_.value '

    objAppointment.AllDayEvent = .T.
    objAppointment.Subject = CUSTOMER_ID_.value + " " + NAME.text + " " + SURNAME.text + " "
    recs = parentform.QueryRun("customer_id_ = "+customer_id_.value) 'get a count of the records with the same customer_id as the record visible on the form
    if recs > 0
    parentform.Fetch_first()
    objAppointment.Body = CUSTOMER_ID_.value + " " + NAME.text + " " + SURNAME.text + crlf(1) + " Mobile Numbers= "+ CONTACT_NUMBER1.VALUE +crlf(1) +" Phone Numbers= "+ CONTACT_NUMBER_2.VALUE +crlf(1) + ADDRESS.TEXT +crlf(1)+ ADDRESS2.TEXT +crlf(1)+ TOWN.TEXT+crlf(1)+COUNTY.TEXT +crlf(1)+POSTCODE.TEXT +crlf(2)+ " E-MAIL = " + EMAIL_ADDRESS_.TEXT + crlf(2) + crlf(3)+ "NOTES" +crlf(2)+ Notes_.value + crlf(3) + "TS_______ INV________ Paid_________ Unpaid________ Last Charge___________" + crlf(2) + "previous jobs below " + crlf(2)
    for qx = 1 to recs -1
    parentform.Fetch_next()
    objAppointment.Body = CUSTOMER_ID_.value + " " + NAME.text + " " + SURNAME.text + crlf(1) + " Mobile Numbers= "+ CONTACT_NUMBER1.VALUE +crlf(1) +" Phone Numbers= "+ CONTACT_NUMBER_2.VALUE +crlf(1) + ADDRESS.TEXT +crlf(1)+ ADDRESS2.TEXT +crlf(1)+ TOWN.TEXT+crlf(1)+COUNTY.TEXT +crlf(1)+POSTCODE.TEXT +crlf(2)+ " E-MAIL = " + EMAIL_ADDRESS_.TEXT + crlf(2) + crlf(3)+ "NOTES" +crlf(2)+ Notes_.value + crlf(3) + "TS_______ INV________ Paid_________ Unpaid________ Last Charge___________" + crlf(2) + "previous jobs below " + crlf(2)
    next
    end if
    objAppointment.Location = CONTACT_NUMBER1.value + " " + POSTCODE.TEXT '
    objAppointment.ReminderMinutesBeforeStart = 15
    objAppointment.ReminderSet = .T.

    objAppointment.Save()


    ui_msg_box("Confirmation","Appointment Booked" )

    The problem im getting with this code is that the the body field of the appointmnet still only contains one records worth of data and is not keeping each record after one another and only puts in the latest record HEEEELLLPPPPPPPP----- ( I BET BY NOW EVERY ONE IS PISSED OFF WITH THIS :-P )

  8. #38
    Member
    Real Name
    david
    Join Date
    Jan 2013
    Posts
    17

    Default Re: Outlook Calendar and Tasks

    Quote Originally Posted by viiddi View Post
    HERE IS WHAT I PUT TOGETHER



    dim objOutlook as P


    constant olAppointmentItem = 1

    objOutlook = ole.GetObject("","Outlook.Application")

    objAppointment = objOutlook.CreateItem(olAppointmentItem)


    objAppointment.Start = DATE_OF_APPOITNMENT_.value '

    objAppointment.AllDayEvent = .T.
    objAppointment.Subject = CUSTOMER_ID_.value + " " + NAME.text + " " + SURNAME.text + " "
    recs = parentform.QueryRun("customer_id_ = "+customer_id_.value) 'get a count of the records with the same customer_id as the record visible on the form
    if recs > 0
    parentform.Fetch_first()
    objAppointment.Body = CUSTOMER_ID_.value + " " + NAME.text + " " + SURNAME.text + crlf(1) + " Mobile Numbers= "+ CONTACT_NUMBER1.VALUE +crlf(1) +" Phone Numbers= "+ CONTACT_NUMBER_2.VALUE +crlf(1) + ADDRESS.TEXT +crlf(1)+ ADDRESS2.TEXT +crlf(1)+ TOWN.TEXT+crlf(1)+COUNTY.TEXT +crlf(1)+POSTCODE.TEXT +crlf(2)+ " E-MAIL = " + EMAIL_ADDRESS_.TEXT + crlf(2) + crlf(3)+ "NOTES" +crlf(2)+ Notes_.value + crlf(3) + "TS_______ INV________ Paid_________ Unpaid________ Last Charge___________" + crlf(2) + "previous jobs below " + crlf(2)
    for qx = 1 to recs -1
    parentform.Fetch_next()
    objAppointment.Body = CUSTOMER_ID_.value + " " + NAME.text + " " + SURNAME.text + crlf(1) + " Mobile Numbers= "+ CONTACT_NUMBER1.VALUE +crlf(1) +" Phone Numbers= "+ CONTACT_NUMBER_2.VALUE +crlf(1) + ADDRESS.TEXT +crlf(1)+ ADDRESS2.TEXT +crlf(1)+ TOWN.TEXT+crlf(1)+COUNTY.TEXT +crlf(1)+POSTCODE.TEXT +crlf(2)+ " E-MAIL = " + EMAIL_ADDRESS_.TEXT + crlf(2) + crlf(3)+ "NOTES" +crlf(2)+ Notes_.value + crlf(3) + "TS_______ INV________ Paid_________ Unpaid________ Last Charge___________" + crlf(2) + "previous jobs below " + crlf(2)
    next
    end if
    objAppointment.Location = CONTACT_NUMBER1.value + " " + POSTCODE.TEXT '
    objAppointment.ReminderMinutesBeforeStart = 15
    objAppointment.ReminderSet = .T.

    objAppointment.Save()


    ui_msg_box("Confirmation","Appointment Booked" )

    )
    The problem im getting with this code is that the the body field of the appointmnet still only contains one records worth of data and is not keeping each record after one another and only puts in the latest record HEEEELLLPPPPPPPP----- ( I BET BY NOW EVERY ONE IS PISSED OFF WITH THIS :-P

  9. #39
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,017

    Default Re: Outlook Calendar and Tasks

    David,

    Try to work with one record only.

    Copy and paste this code on the xBasic Script, save and Run it. After run it, open your outlook see the appointment date and show me the result.

    Code:
    '// this is called variables. 
    vStatDate = "1/16/2014 11:00 AM" 
    vDuration = 4
    vDayEvent = .t.
    vSubject = "Test My first Appointment"
    vBody = "Test Body work with outlook"
    'Location --- 'I do not know what it is ref. So I left it as is now
    vReminder = 15
    vRemSet = .t.
    
    '===== End ==========
    
    '========== Start the Outlook OLE ==============
    
    dim objOutlook as P
    constant olAppointmentItem = 1
    objOutlook = ole.GetObject("","Outlook.Application")
    objAppointment = objOutlook.CreateItem(olAppointmentItem)
    
    objAppointment.Start = vStartDate
    objAppointment.Duration = vDuration
    objAppointment.AllDayEvent = vDayEvent
    objAppointment.Subject = vSubject
    objAppointment.Body = vBody
    objAppointment.Location = "44/2039"  
    objAppointment.ReminderMinutesBeforeStart = vReminder
    objAppointment.ReminderSet = vRemSet
    
    
    objAppointment.Save()
    
    
    ui_msg_box("Confirmation","Appointment Booked" )

  10. #40
    Member
    Real Name
    david
    Join Date
    Jan 2013
    Posts
    17

    Default Re: Outlook Calendar and Tasks

    Quote Originally Posted by johnkoh View Post
    David,

    Try to work with one record only.

    Copy and paste this code on the xBasic Script, save and Run it. After run it, open your outlook see the appointment date and show me the result.

    Code:
    '// this is called variables. 
    vStatDate = "1/16/2014 11:00 AM" 
    vDuration = 4
    vDayEvent = .t.
    vSubject = "Test My first Appointment"
    vBody = "Test Body work with outlook"
    'Location --- 'I do not know what it is ref. So I left it as is now
    vReminder = 15
    vRemSet = .t.
    
    '===== End ==========
    
    '========== Start the Outlook OLE ==============
    
    dim objOutlook as P
    constant olAppointmentItem = 1
    objOutlook = ole.GetObject("","Outlook.Application")
    objAppointment = objOutlook.CreateItem(olAppointmentItem)
    
    objAppointment.Start = vStartDate
    objAppointment.Duration = vDuration
    objAppointment.AllDayEvent = vDayEvent
    objAppointment.Subject = vSubject
    objAppointment.Body = vBody
    objAppointment.Location = "44/2039"  
    objAppointment.ReminderMinutesBeforeStart = vReminder
    objAppointment.ReminderSet = vRemSet
    
    
    objAppointment.Save()
    
    
    ui_msg_box("Confirmation","Appointment Booked" )
    ok so that code works for one record the one im working on which is fine here is the result

    code work for one record.png

  11. #41
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,017

    Default Re: Outlook Calendar and Tasks

    David,

    That is great. Now do you have a sample table?
    If you do, show me the Structure and some of data or zip file here so I can make my side sample.

  12. #42
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,017

    Default Re: Outlook Calendar and Tasks

    David,

    Please, find this fetch_1.jpg from A5 help and read.
    It will be next step to do.

  13. #43
    Member
    Real Name
    david
    Join Date
    Jan 2013
    Posts
    17

    Default Re: Outlook Calendar and Tasks

    ok so this is doing my nut in is there a way the transfer the browser from a form into outlook appoinmnetbody as i filter the browse for the records i want all ones matching the customers id with the fields in the browse this is doing my nutt pwease anybody help i just cant seem to get my head around xbasic coding

  14. #44
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,017

    Default Re: Outlook Calendar and Tasks

    David,

    OK, Make the sample database.
    I made one from A5 sample. (1) from Tables/sets control panel --> select "New" button ---> Using Genie --> Select "event list" from template name.
    ===> Selected "include sample data ==> Next , table name as "event" ==> Finish.


    Now you have the table with sample data.

    I have attached the screenshots for your reference.

    lesson_table.jpglesson_Data.jpgLesson_form_01.jpg

  15. #45
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,017

    Default Re: Outlook Calendar and Tasks

    David,

    The xbasic is easy once you know how to and the concept of the command.

    I created two buttons without any "action"

    lesson_form_button.jpg


    I do not have good skill of teaching or writing but I can help you.

    a) Button1 will be a case A --> Just the records from Form, whatever you see.
    1) Which records and fields(value)
    2) and How to find the records?
    3) Two method; object and table method

    b) Button2 will be a case B --> read from table's records
    1) Which records and fields(value)
    2) and How to find the records?
    3) How to find and read the table's records -- query-method, index-method, array-method

    Think about those cases and will show you more on tomorrow

  16. #46
    Member
    Real Name
    david
    Join Date
    Jan 2013
    Posts
    17

    Default Re: Outlook Calendar and Tasks

    Quote Originally Posted by johnkoh View Post
    David,

    OK, Make the sample database.
    I made one from A5 sample. (1) from Tables/sets control panel --> select "New" button ---> Using Genie --> Select "event list" from template name.
    ===> Selected "include sample data ==> Next , table name as "event" ==> Finish.


    Now you have the table with sample data.

    I have attached the screenshots for your reference.

    lesson_table.jpglesson_Data.jpgLesson_form_01.jpg
    ok ive created the sample database same as yours now i want a button to import all the data shown on the event form into the body of an appoinmnet o outllook on the start date but i also want all the other record in the body of the appoinment aswell so event id 01 02 03 and all data corespondiing in the single body of the appoinmnet

  17. #47
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,017

    Default Re: Outlook Calendar and Tasks

    Good Morning,

    ** assumed you know the definition of the VARIABLES, but not know how to use it.

    First, I want to show you how to use the variables.

    Created the UDF
    Code:
    'It will show How to pass the variables from a to b
    FUNCTION myfirst_udf AS A (ptr as p)
            '// " With ..end with " is called NameSpace Function. A5 will be passing the variables within
    	with ptr
                    
    		'Case 1; Check the form's value
    		msgbox("from UDf ","Show the PASSING Result from UDF "+crlf()+"Start Date: "+vStartDate )
    		
    		'=========== Case 2; Change the value here and show the revised value ==============
                    'Hold this until 2nd lesson
    		'vRevisedDate = {1/1/2014}
    		'vStartDate = vRevisedDate   'or you can write vStartDate = {1/1/2014}  'which is simple way
    		'Test for Same MsgBox
    		'msgbox("from UDf ","Changed the value at UDF "+crlf()+"Start Date: "+vStartDate )
    	end with
    END FUNCTION
    created the 3rd button and named as "passing variables". Insert this code on this button push event.

    Code:
    'Save record in current form.
    topparent.commit()
    
    
    
    'Get 'Value' property of 'Start_date' in Form 'Event_List' .
    DIM shared vStartDate AS d
    
    'Lesson 2; Check after delete shared variable
    'DIM vStartDate AS d
    
    vStartDate = parentform:Start_date.value
    
    
    'test passing variables
    myfirst_udf(local_variables())
    after done the above, you will see the message when you press the 3rd button.

    See the "lesson 2", make it as activate after try 1st.
    Last edited by johnkoh; 03-18-2014 at 02:39 PM. Reason: typo

  18. #48
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,017

    Default Re: Outlook Calendar and Tasks

    David,

    Try Lesson 2 or Case 2 and see what is going on the Passing variables

    from button3, changed this to activate red or blue color
    Code:
    'Get 'Value' property of 'Start_date' in Form 'Event_List' .
    ' DIM shared vStartDate AS d
    
    'Lesson 2; Check after delete shared variable. 
    DIM vStartDate AS d
    
    vStartDate = parentform:Start_date.value
    From myFirst_udf

    Code:
    		'=========== Case 2; Change the value here and show the revised value ==============
                    'Hold this until 2nd lesson
    		vRevisedDate = {1/1/2014}
    		vStartDate = vRevisedDate   'or you can write vStartDate = {1/1/2014}  'which is simple way
    		'Test for Same MsgBox with same variable name -- changed the value, not same as the form's value
    		msgbox("from UDf ","Changed the value at UDF "+crlf()+"Start Date: "+vStartDate )
    This is the basic of the passing values to other codes and programming with it.

    If you are not sure, post the questions.
    Last edited by johnkoh; 03-18-2014 at 12:17 PM. Reason: typo

  19. #49
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,017

    Default Re: Outlook Calendar and Tasks

    Next, Create the Outlook ole udf,
    Code:
    FUNCTION outlook_ole AS A (ptr AS P )
    	with ptr
    	'========== Start the Outlook OLE ==============
    	
    	dim objOutlook as P
    	constant olAppointmentItem = 1
    	objOutlook = ole.GetObject("","Outlook.Application")
    	objAppointment = objOutlook.CreateItem(olAppointmentItem)
    	
    	objAppointment.Start = vStartDate    '<<=== the variable and make sure same name when you create the below at button1
    	objAppointment.Duration = vDuration
    	objAppointment.AllDayEvent = vDayEvent
    	objAppointment.Subject = vSubject
    	objAppointment.Body = vBody
    	objAppointment.Location = vLocation 
    	objAppointment.ReminderMinutesBeforeStart = vReminder
    	objAppointment.ReminderSet = vRemSet
    	
    	
    	objAppointment.Save()
    
    
    'ui_msg_box("Confirmation","Appointment Booked" )	
    	end with
    
    END FUNCTION

    Button1; current data
    * How to get the value?
    1) Create the variables with current form's value which called the object method.
    1-a) onpush event -- open an ActionScripts
    1-b) See the attachments and create the variables as you need
    1-c) Watch on the variable name. you have to create same name as the Outlook_ole udf

    2) Select a form/record to export to outlook then press the button 1, you should get a(one you have selected) same appointment from outlook.

    Lesson_btn1_event.jpglesson_btn1_eventDetail.jpgLesson_object.jpg


    I noticed that the table does not have the Reminder and reminderSet so you may write the variables as
    dim vReminder as L = .t.
    dim vRemSet = 15

  20. #50
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,017

    Default Re: Outlook Calendar and Tasks

    David,

    now i want a button to import all the data shown on the event
    After you done the above, let me know.
    Next step is "Reading from table ". Sorry, You have to understand the variable and how to get the data from simple way(?) before complex(?) code way.

  21. #51
    Member
    Real Name
    david
    Join Date
    Jan 2013
    Posts
    17

    Default Re: Outlook Calendar and Tasks

    Hi every one long time no speak

    ive made considerabloe progress in alpha working with outllok pulling info from table etc etc lernt alot of coding thanks to that

    ive got a question to do with ms word mail merging basically i want to record in my customers db record when and what letter i have sent them automatically when i do a mail merge..

    basically i have a buton on screen for when i want to send them a letter via mail merge i click it brings up a list of my letters i have preconfigured and it merges the client info straight acroos to word and done.

    what i now want to do is when that happens i want it to record what ive done in the clients record say in a table called letters joint to the customer via the unique id. ho would i go about doing this also it n=be great if the file auto saves to the clients specific folder based on ther unique id i understand this bit can be done via macros in word to a degree

    i know this question is in the wrong section but you have all been of great help so far

    many thanks dave

Similar Threads

  1. Repeated Tasks using a Date calc.
    By Alan Lucas in forum Alpha Five Version 6
    Replies: 2
    Last Post: 06-08-2005, 06:01 AM
  2. Have email use Outlook instead of Outlook Express
    By George Corder in forum Alpha Five Version 5
    Replies: 2
    Last Post: 12-24-2004, 02:52 PM
  3. Calendar Add In - Day Calendar
    By scottly in forum Alpha Five Version 5
    Replies: 1
    Last Post: 08-08-2003, 07:58 AM
  4. Can A5 v4 integrate w/Outlook or another Calendar/
    By Harv Tretsky in forum Code Archive
    Replies: 18
    Last Post: 07-24-2003, 09:00 PM
  5. Sent emails using Outlook
    By Rick Valenzuela in forum Alpha Five Version 5
    Replies: 1
    Last Post: 11-04-2002, 01:14 PM

Bookmarks

Posting Permissions

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