I have a server which will send my daily plans once every day to my application i've written in blackberry. Now i want to store all those in my calendar in blackberry 8520. Is it possible? Please tell what api's i should use. Thank you
Try this code.
Event _event;
Calenderevent = "Event name";
EventList eventList = (EventList) PIM.getInstance().openPIMList(PIM.EVENT_LIST, PIM.WRITE_ONLY);
_event = eventList.createEvent();
long l = "Event date in long format";
_event.addString(Event.SUMMARY, PIMItem.ATTR_NONE,Calenderevent);
_event.addDate(Event.START, PIMItem.ATTR_NONE, l);
RepeatRule rule = new RepeatRule();
rule.setInt(RepeatRule.FREQUENCY,RepeatRule.YEARLY);
_event.setRepeat(rule);
//If you need to repeat the event then use repeatrule.
_event.commit();
Related
Need your help and expert guidance as I need my google sheet to send emails every time a condition becomes true in "K" column which is named "Subject" as a header in the tab name "Analysis". Whenever I run the below code. Similarly last 3 lines I get while running the code as errors. Please explain in a simple possible way and not too much technical
function sendEmail(){
var ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Analysis");
var range = ss.getRange("J2:J35");
range.clear();
var n = ss.getLastRow();
for (var i = 2;i<n+1; i++){
var emailRequired = ss.getRange(i,9).getValue();
var subject = ss.getRange(i,11).getvalue();
var message = ss.getRange(i,12).getvalue();
if (emailRequired=="YES"){
MailApp.sendEmail("ksm272364#gmail.com",subject,message);
ss.getRange(i,10).setvalue("YES");
}
}
}
1:21:51 PM Error
TypeError: ss.getRange(...).getvalue is not a function
sendEmail # Code.gs:8
I opened a thread recently at: Update partial with Ajax in Rails 3
Actually, thanks to Wizard of Ogz, everything works but it is very slow when I move the mouse between two items which are far away from each other since XMLHTTPRequest are sent for each item in between...
I thought about aborting the request if the interval between mouseenter and mouseleave is lower than a threshold but it does not help.
I also tried to add a timer to trigger the request close to the "expiration time" so that the request doesn't have the time to be answered if the same interval is too small but without success again.
Here is the code:
var timeStart, timeEnd;
$("div.show_item").mouseenter(function(event){
timeStart = (new Date()).getTime();
var id = $(this).attr('data');
var url = "/item/list?id="+id;
var data = $(this).serialize();
setTimeout(xhr = $.post(url, function(response_data){$("#item_details").html(response_data)}),290);
return false;
}).mouseleave(function(event){
timeEnd = (new Date()).getTime();
if(timeEnd - timeStart < 300)
xhr.abort();
});
Thank you in advance for your help.
I am trying to create an appointment using CDOEX in Exchange 2000. The code snippet is from msdn and is VB6.
When I reach this line: ".DataSource.SaveToContainer iMbx.Calendar, Conn" I am getting error "cannot complete the function (800703eb)"
Any help will be appreciated!
Function CreateAppointment(StartTime As Date, _
EndTime As Date, _
Subject As String, _
Location As String, _
TextBody As String, _
iMbx As IMailbox) As Appointment
' Reference to Microsoft ActiveX Data Objects 2.5 Library
' Reference to Microsoft CDO for Exchange 2000 Library
Dim iAppt As New Appointment
Dim Conn As New ADODB.Connection
Conn.Provider = "ExOLEDB.DataSource"
'Set the appointment properties
With iAppt
.StartTime = StartTime
.EndTime = EndTime
.Subject = Subject
.Location = Location
.TextBody = TextBody
'Save the appointment
Conn.Open iMbx.BaseFolder
.DataSource.SaveToContainer iMbx.Calendar, Conn
End With
Set CreateAppointment = iAppt
End Function
I have found the problem and solution, so here it is in case somebody needs it: link
Also, I have found examples that saved my life: link
I need to put several reminders in the BB calendar.
The idea is several hours, or days before a promo expires, the alarm will remind it for you.
Here's my code so far:
long ONE_HOUR = 3600;
long ONE_DAY = 24 * 3600;
try {
EventList eventList = (EventList)PIM.getInstance().openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE);
BlackBerryEvent bbEvent = (BlackBerryEvent) eventList.createEvent();
FavoritePromo promo;
if (eventList.isSupportedField(BlackBerryEvent.ALARM)){
for (int x = 0; x < promos.size(); x++){
promo = (FavoritePromo) promos.elementAt(x);
time = (StringUtil.strToDate(promo.getExpireDate())).getTime() - value;
bbEvent.addString(BlackBerryEvent.SUMMARY, BlackBerryEvent.ATTR_NONE, promo.getTitle());
bbEvent.addDate(BlackBerryEvent.ALARM,0,time);
bbEvent.commit();
}
}
}
catch (PIMException e){
}
Every time i run it, an "IllegalArgumentException" is always thrown. I'm not really sure what goes wrong here...
BlackBerryEvent ev = (BlackBerryEvent) _event;
ev.addInt(BlackBerryEvent.ALARM,
BlackBerryEvent.ATTR_NONE,remMinInt*60);
_event.commit();
I think that this is wrong:
bbEvent.addDate(BlackBerryEvent.ALARM,0,time)
and that you should use:
bbEvent.addInt(BlackBerryEvent.ALARM,0,time2)
take care that "time2" is long !
And you can add two other dates for example:
bbEvent.addDate(bbEvent.START, PIMItem.ATTR_NONE,
System.currentTimeMillis()+120000);
bbEvent.addDate(bbEvent.END, PIMItem.ATTR_NONE,
System.currentTimeMillis()+360000);
Try it and tell me your experience in it.
I am generating a report using OpenXML and exporting it to excel. I want to protect the excel sheet except for a particular cell.
If anyone has worked on this before, kindly help
Thanks,
Amolik
PageMargins pageM = worksheetPart.Worksheet.GetFirstChild<PageMargins>();
SheetProtection sheetProtection = new SheetProtection();
sheetProtection.Password = "CC";
sheetProtection.Sheet = true;
sheetProtection.Objects = true;
sheetProtection.Scenarios = true;
ProtectedRanges pRanges = new ProtectedRanges();
ProtectedRange pRange = new ProtectedRange();
ListValue<StringValue> lValue = new ListValue<StringValue>();
lValue.InnerText = "A1:E1"; //set cell which you want to make it editable
pRange.SequenceOfReferences = lValue;
pRange.Name = "not allow editing";
pRanges.Append(pRange);
worksheetPart.Worksheet.InsertBefore(sheetProtection, pageM);
worksheetPart.Worksheet.InsertBefore(pRanges, pageM);
ref : http://social.msdn.microsoft.com/Forums/en-US/a6f7502d-3867-4d5b-83a9-b4e0e211068f/how-to-lock-specific-columns-in-xml-workbook-while-exporting-dataset-to-excel?forum=oxmlsdk
Have you tried using the OpenXML Productivity Toolkit?
from what I can see you have to add a
new CellFormat
with attribute
ApplyProtection = true
to
CellFormats
append
new Protection
with attribute
Locked = false
to the the CellFormat you created.
CellFormat is a element of CellFormats which is a element of Stylesheet
then to the Worksheet you add a
new SheetProtection(){ Password = "CC1A", Sheet = true, Objects = true, Scenarios = true };
I havent tried this, but it should be easy enought to find out what you need to do with the Productivity Toolkit. I hope this points you and anyone trying to do this in the right direction.