Jump to content

Syl21

Members
  • Posts

    15
  • Joined

  • Last visited

Syl21's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Thx for your help, and sorry again
  2. Hello, I have create a lite script, so you can try... I have a first graphical interface and when you select "+" that open a second graphical function The question is: How can I close this new graphical function without closing my software??? Thx in Adv #include <GUIConstantsEx.au3> #include <GuiIPAddress.au3> $softname = "TEST" $main_GUI=GUICreate($SoftName, 500, 600) $save=GUICtrlCreateButton("+", 250, 570, 30) $exitbutton=GUICtrlCreateButton("Exit", 430, 570,60) GUISetState(@SW_SHOW) While 1 $msg=GUIGetMsg() Select Case $msg=$save $line=save_IP() msgbox(0,"result","Name:"&$line[0]&" IP:"&$line[1]&" Mask:"&$line[2]&" Gateway:"&$line[3]) Case $msg=$exitbutton iniWrite($INI, "interface", "default", GUICtrlRead($combo_interface)) ExitLoop Case $msg=$GUI_EVENT_CLOSE iniWrite($INI, "interface", "default", GUICtrlRead($combo_interface)) ExitLoop EndSelect WEnd Func Save_IP() $add_GUI=GUICreate($SoftName&" - Add Address", 600, 100) GUICtrlCreateLabel("Connection Name", 30, 10) $name=GUICtrlCreateInput("", 10, 35, 150) GUICtrlCreateLabel("IP", 230, 10) $IP=_GUICtrlIpAddress_Create($add_GUI, 170, 35) GUICtrlCreateLabel("NetMask", 350, 10) $Mask=_GUICtrlIpAddress_Create($add_GUI, 300, 35) GUICtrlCreateLabel("Gateway", 480, 10) $Gateway=_GUICtrlIpAddress_Create($add_GUI, 430, 35) $save=GUICtrlCreateButton("Save", 560, 35, 30) GUISetState(@SW_SHOW) While 1 $msg=GUIGetMsg() Select Case $msg=$save if $Name AND $IP AND $Mask AND $Gateway Then Dim $line[4] $line[0]=$name $line[1]=$IP $line[2]=$Mask $line[3]=$Gateway Return($line) Else msgbox(0,"Error","Missing Information") EndIf Case $msg=$GUI_EVENT_CLOSE Return EndSelect Wend EndFunc
  3. Hello, To be sure I have try this: With $oOutlook.GetNamespace("MAPI").GetDefaultFolder($olFolderCalendar).Items .Sort("[Start]", False) .IncludeRecurrences = True $Items=.Restrict("[Start] >= '"&StringStripCR(_ExcelReadCell($oExcel, $DateLine, $StartDataColumn))&" 00:00'") EndWith With .IncludeRecurrences = True & False But nothing Change, I don't have totaly understand your answer... Sorry, I'm french and my english still bad!!! Thx Again
  4. I'm creating a code for creating and deleting calendar events in outlook. When I create an events, I use a UserProperties with my softwarename to recognize them later. When I scan to delete, I just want scan every event and verify if the UserProperties is well Set (Just to be sure I don't delete a IMPORTANT handmade event) Normally this code must work but I don't know why, $Items don't contain every calandar events... Some body have an idea???? Thanks in Advance $olFolderCalendar=9 $oOutlook = _OutlookOpen() $Items = $oOutlook.GetNamespace("MAPI").GetDefaultFolder($olFolderCalendar).Items $t=0 for $Item In $Items $t+=1 msgbox(1,"test"&$t,$Item.subject) If IsObj($Item.UserProperties($SoftName)) Then $Item.Delete EndIf Next
  5. Hello, You have a bug in function _ExcelCommentRead If Cell have no comments that Crash... Can you help me to correct-it???
  6. Here is a start of _OutlookDeleteAppointment() I'm sure lot of things can be improve... ;=============================================================================== ; ; Function Name: _OutlookDeleteAppointment() ; Description: Delete an appointment using Microsoft Outlook. ; Syntax.........: _OutlookDeleteAppointment($oOutlook, $sSubject, $sStartDate, $sNewSubject = "", $sNewStartDate = "", $sEndDate = "", $sLocation = "", $fAllDayEvent = False, $sBody = "", $sReminder = 15, $sShowTimeAs = "", $iImportance = "", $iSensitivity = "", $iRecurrenceType = "", $sPatternStartDate = "", $sPatternEndDate = "", $iInterval = "", $iDayOfWeekMask = "", $iDay_MonthOfMonth_Year = "", $iInstance = "") ; Parameter(s): $oOutlook - Outlook object opened by a preceding call to _OutlookOpen(). ; $sSubject - The Subject of the Appointment. ; $sStartDate - Start date & time of the Appointment, format YYYY-MM-DD HH:MM - or what is set locally. ; $sNewSubject - Optional: New Subject of the Appointment. ; $sNewStartDate - Optional: New start date & time of the Appointment, format YYYY-MM-DD HH:MM - or what is set locally. ; $sEndDate - Optional: End date & time of the Appointment, format YYYY-MM-DD HH:MM - or what is set locally. ; Number of minutes. ; $sLocation - Optional: The location where the meeting is going to take place. ; $fAllDayEvent - Optional: True or False if set to True and the appointment is lasting for more than one day, end Date ; must be one day higher than the actual end Date. ; $sBody - Optional: The Body of the Appointment. ; $sReminder - Optional: Reminder in Minutes before start, 0 for no reminder ; $sShowTimeAs - Optional: $olBusy=2, $olFree=0, $olOutOfOffice=3, $olTentative=1 ; $iImportance - Optional: $olImportanceNormal=1, $olImportanceHigh=2, $olImportanceLow=0 ; $iSensitivity - Optional: $olNormal=0, $olPersonal=1, $olPrivate=2, $olConfidential=3 ; $iRecurrenceType - Optional: $olRecursDaily=0, $olRecursWeekly=1, $olRecursMonthly=2, $olRecursMonthNth=3, $olRecursYearly=5, $olRecursYearNth=6. Remove Recurrence=-1 ; $sPatternStartDate - Optional: Start Date of the Reccurent Appointment, format YYYY-MM-DD - or what is set locally. ; $sPatternEndDate - Optional: End Date of the Reccurent Appointment, format YYYY-MM-DD - or what is set locally. ; $iInterval - Optional: Interval between the Reccurent Appointment ; $iDayOfWeekMask - Optional: Add the values of the days the appointment shall occur. $olSunday=1, $olMonday=2, $olTuesday=4, $olWednesday=8, $olThursday=16, $olFriday=32, $olSaturday=64 ; $iDay_MonthOfMonth_Year - Optional: DayOfMonth or MonthOfYear, Day of the month or month of the year on which the recurring appointment or task occurs ; $iInstance - Optional: This property is only valid for recurrences of the $olRecursMonthNth and $olRecursYearNth type and allows the definition of a recurrence pattern that is only valid for the Nth occurrence, such as "the 2nd Sunday in March" pattern. The count is set numerically: 1 for the first, 2 for the second, and so on through 5 for the last. Values greater than 5 will generate errors when the pattern is saved. ; Requirement(s): AutoIt3 with COM support (post 3.1.1) ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 and sets @ERROR > 0 ; @ERROR = 1 - Illegal parameters ; @ERROR = 2 - Appointment not found ; @ERROR = 9 - ObjEvent error. ; Author(s): Wooltown ; Created: 2009-02-23 ; Modified: - ; ;=============================================================================== Func _OutlookDeleteAppointment($oOutlook, $sSubject, $sStartDate = "", $sEndDate = "", $sLocation = "", $fAllDayEvent = "", $sBody = "", $sReminder = "", $sShowTimeAs = "", $iImportance = "", $iSensitivity = "", $iRecurrenceType = "", $sPatternStartDate = "", $sPatternEndDate = "", $iInterval = "", $iDayOfWeekMask = "", $iDay_MonthOfMonth_Year = "", $iInstance = "") Local $iRc = 0, $fItemFound = False, $fIsRecurring, $oRecPatt, $oOrig Local $oOuError = ObjEvent("AutoIt.Error", "_OutlookError") Local $oNamespace = $oOutlook.GetNamespace("MAPI") Local $oFolder = $oNamespace.GetDefaultFolder($olFolderCalendar) Local $oColItems = $oFolder.Items $oColItems.Sort("[Start]") $oColItems.IncludeRecurrences = True Local $sFilter = '[Subject] = "' & $sSubject & '"' Local $oFilteredItems = $oColItems.Restrict($sFilter) For $oItem In $oFilteredItems $fItemFound = True $fIsRecurring = $oItem.IsRecurring If $fIsRecurring = False Then $oItem.Delete $oItem.Close $iRc = @ERROR If $iRc = 0 Or $iRc = -2147352561 Then Return 1 Else Return SetError(9, 0, 0) EndIf Else ; ----- Recurring Appointment, change all occurences $oItem.GetFirst $oRecPatt = $oItem.GetRecurrencePattern ;With $oRecPatt If $sNewStartDate <> "" Then If Not _DateIsValid($sNewStartDate) Then Return SetError(1, 0, 0) $oRecPatt.StartTime = $sNewStartDate EndIf If $sEndDate <> "" Then If _DateIsValid($sEndDate) Then $oRecPatt.EndTime = $sEndDate Else $oRecPatt.Duration = Number($sEndDate) EndIf EndIf $oRecPatt.Save $oRecPatt.Close ;Endwith $oOrig = $oRecPatt.Parent $oOrig.Delete $oOrig.Close $iRc = @ERROR If $iRc = 0 Or $iRc = -2147352561 Then Return 1 Else Return SetError(9, 0, 0) EndIf EndIf Next If $fItemFound = False Then Return SetError(2, 0, 0) EndFunc Enjoy ;~)
  7. Hello, I need some help, I try to improve _OutlookCreateAppointment see here : http://www.autoitscript.com/forum/index.php?showtopic=108957 I have create a _OutlookDeleteAppointment: ;=============================================================================== ; ; Function Name: _OutlookDeleteAppointment() ; Description: Modify an appointment using Microsoft Outlook. ; Syntax.........: _OutlookDeleteAppointment($oOutlook, $sSubject, $sStartDate, $sNewSubject = "", $sNewStartDate = "", $sEndDate = "", $sLocation = "", $fAllDayEvent = False, $sBody = "", $sReminder = 15, $sShowTimeAs = "", $iImportance = "", $iSensitivity = "", $iRecurrenceType = "", $sPatternStartDate = "", $sPatternEndDate = "", $iInterval = "", $iDayOfWeekMask = "", $iDay_MonthOfMonth_Year = "", $iInstance = "") ; Parameter(s): $oOutlook - Outlook object opened by a preceding call to _OutlookOpen(). ; $sSubject - The Subject of the Appointment. ; $sStartDate - Start date & time of the Appointment, format YYYY-MM-DD HH:MM - or what is set locally. ; $sNewSubject - Optional: New Subject of the Appointment. ; $sNewStartDate - Optional: New start date & time of the Appointment, format YYYY-MM-DD HH:MM - or what is set locally. ; $sEndDate - Optional: End date & time of the Appointment, format YYYY-MM-DD HH:MM - or what is set locally. ; Number of minutes. ; $sLocation - Optional: The location where the meeting is going to take place. ; $fAllDayEvent - Optional: True or False if set to True and the appointment is lasting for more than one day, end Date ; must be one day higher than the actual end Date. ; $sBody - Optional: The Body of the Appointment. ; $sReminder - Optional: Reminder in Minutes before start, 0 for no reminder ; $sShowTimeAs - Optional: $olBusy=2, $olFree=0, $olOutOfOffice=3, $olTentative=1 ; $iImportance - Optional: $olImportanceNormal=1, $olImportanceHigh=2, $olImportanceLow=0 ; $iSensitivity - Optional: $olNormal=0, $olPersonal=1, $olPrivate=2, $olConfidential=3 ; $iRecurrenceType - Optional: $olRecursDaily=0, $olRecursWeekly=1, $olRecursMonthly=2, $olRecursMonthNth=3, $olRecursYearly=5, $olRecursYearNth=6. Remove Recurrence=-1 ; $sPatternStartDate - Optional: Start Date of the Reccurent Appointment, format YYYY-MM-DD - or what is set locally. ; $sPatternEndDate - Optional: End Date of the Reccurent Appointment, format YYYY-MM-DD - or what is set locally. ; $iInterval - Optional: Interval between the Reccurent Appointment ; $iDayOfWeekMask - Optional: Add the values of the days the appointment shall occur. $olSunday=1, $olMonday=2, $olTuesday=4, $olWednesday=8, $olThursday=16, $olFriday=32, $olSaturday=64 ; $iDay_MonthOfMonth_Year - Optional: DayOfMonth or MonthOfYear, Day of the month or month of the year on which the recurring appointment or task occurs ; $iInstance - Optional: This property is only valid for recurrences of the $olRecursMonthNth and $olRecursYearNth type and allows the definition of a recurrence pattern that is only valid for the Nth occurrence, such as "the 2nd Sunday in March" pattern. The count is set numerically: 1 for the first, 2 for the second, and so on through 5 for the last. Values greater than 5 will generate errors when the pattern is saved. ; Requirement(s): AutoIt3 with COM support (post 3.1.1) ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 and sets @ERROR > 0 ; @ERROR = 1 - Illegal parameters ; @ERROR = 2 - Appointment not found ; @ERROR = 9 - ObjEvent error. ; Author(s): Wooltown ; Created: 2009-02-23 ; Modified: - ; ;=============================================================================== Func _OutlookDeleteAppointment($oOutlook, $sSubject, $sStartDate = "", $sEndDate = "", $sLocation = "", $fAllDayEvent = "", $sBody = "", $sReminder = "", $sShowTimeAs = "", $iImportance = "", $iSensitivity = "", $iRecurrenceType = "", $sPatternStartDate = "", $sPatternEndDate = "", $iInterval = "", $iDayOfWeekMask = "", $iDay_MonthOfMonth_Year = "", $iInstance = "") Local $iRc = 0, $fItemFound = False, $fIsRecurring, $oRecPatt, $oOrig Local $oOuError = ObjEvent("AutoIt.Error", "_OutlookError") Local $oNamespace = $oOutlook.GetNamespace("MAPI") Local $oFolder = $oNamespace.GetDefaultFolder($olFolderCalendar) Local $oColItems = $oFolder.Items $oColItems.Sort("[Start]") $oColItems.IncludeRecurrences = True Local $sFilter = '[Subject] = "' & $sSubject & '"' Local $oFilteredItems = $oColItems.Restrict($sFilter) For $oItem In $oFilteredItems $fItemFound = True $fIsRecurring = $oItem.IsRecurring If $fIsRecurring = False Then $oItem.Delete $oItem.Close $iRc = @ERROR If $iRc = 0 Or $iRc = -2147352561 Then Return 1 Else Return SetError(9, 0, 0) EndIf Else ; ----- Recurring Appointment, change all occurences $oItem.GetFirst $oRecPatt = $oItem.GetRecurrencePattern ;With $oRecPatt If $sNewStartDate <> "" Then If Not _DateIsValid($sNewStartDate) Then Return SetError(1, 0, 0) $oRecPatt.StartTime = $sNewStartDate EndIf If $sEndDate <> "" Then If _DateIsValid($sEndDate) Then $oRecPatt.EndTime = $sEndDate Else $oRecPatt.Duration = Number($sEndDate) EndIf EndIf $oRecPatt.Save $oRecPatt.Close ;Endwith $oOrig = $oRecPatt.Parent $oOrig.Delete $oOrig.Close $iRc = @ERROR If $iRc = 0 Or $iRc = -2147352561 Then Return 1 Else Return SetError(9, 0, 0) EndIf EndIf Next If $fItemFound = False Then Return SetError(2, 0, 0) EndFunc Thx in Advance Outlook.au3
  8. Hello, Thanks for your answer... I try the second solution for the moment but doesn't seem's to work... The outlook appointment object creation work, if you copy past my code and just comment : .UserProperties.Add("Uid", "String") .UserProperties("Uid") = $sUid you can recreate my problem... if you can help me more... Thx in Advance
  9. Hello, I need to create appointment on Outlook with a unique ID... I have read here : http://msdn.microsoft.com/en-us/library/....interop.outlook.userproperties.add.aspx That you can create a private field for this kind of usage. I'm working on the WoolTown's Outlook UDF that you can find here : http://www.autoitscript.com/forum/index.php?showtopic=89321 My code seem's like this : #include-once #Include <Date.au3> #Include <Array.au3> const $sSubject = "test" const $sUid = "1234567890" const $sStartDate = "2010-01-27 01:00" const $sEndDate = "2010-01-27 02:00" const $olAppointmentItem=1 const $olSave=0 $oOutlook = ObjCreate("Outlook.Application") Local $oNote = $oOutlook.CreateItem($olAppointmentItem) With $oNote .UserProperties.Add("Uid", "String") .UserProperties("Uid") = $sUid .Subject = $sSubject .Start = $sStartDate .End = $sEndDate .Save .Close ($olSave) EndWith But the result as you can see on attached file is not what i want lol If somebody can explain me why doesn't it work??? Thx in Advance
  10. I have create a function... If someone want to better it and had it to ExcelCOM_UDF.au3, it's a pleasure for me... Func _ExcelIsThisCellMerged($oExcel, $RowStart, $ColStart) If NOT IsObj($oExcel) Then Return SetError(1) If NOT StringRegExp($RowStart, "[A-Z,a-z]", 0) Then If $ColStart < 1 Then Return SetError(2) $Merged = $oExcel.Cells($RowStart, $ColStart).MergeCells EndIf if $Merged < 0 then $Merged = 1 EndIf Return $Merged EndFunc ;==>_ExcelCellMerge Enjoy
  11. Hello everybody... I'have a problem about merged cells i'm using this "#include <ExcelCOM_UDF.au3>" I can merge or unmerge cells but i don't want that I just want know how many collums my merged cell take??? can you help me please??? do you know how to create a include fonction??? thanks in advance...
  12. How can i edit my post to write RESOLVE inside??? thanks in advance
  13. Thanks for your answer Fu...ng Bracket lol Have a good day
  14. I have found my solution: $test= StringRegExp ( $sCellValue, "\d{14}" ) I don't know why [:digit:] don't work... If somebody know...
  15. Data in excel: Engineer 01082009000000 02082009000000 03082009000000 Contact Numbers Base AutoIt Script: $sCellValue=_ExcelReadCell($oExcel, $LIGNEDATE, $Colonne) $test= StringRegExp ( $sCellValue, '[:digit:]{14}' ) MsgBox(0, "Error!", "debut"&$sCellValue&"fin donc resulat= "&$test) $test always send "0" I want $test="1" when data is like 02082009000000 Can you help me??? I don't know why that doesn't work... Thanks in advance
×
×
  • Create New...