
ibigpapa
Members-
Posts
14 -
Joined
-
Last visited
ibigpapa's Achievements

Seeker (1/7)
0
Reputation
-
Ok found a few other errors when i attempt to return these properties (i'm pulling the properties from http://msdn.microsoft.com/en-us/library/office/aa210946(v=office.11).aspx) FlagStatus Links FlagDueBy FlagIcon EnableSharedAttachments IsIPFax HasCoverSheet #include<outlookEX.au3> #include<outlookExConstants.au3> #include<Array.au3> $oOutlook = _OL_Open() $Folder = "*" $objectClass = $olMail $Filter = "" $searchName = "" $searchValue = "" $returnProperties = "To,FlagStatus" ;$returnProperties = "To,Links" ;$returnProperties = "To,FlagDueBy" ;$returnProperties = "To,FlagIcon" ;$returnProperties = "To,EnableSharedAttachments" ;$returnProperties = "To,IsIPFax" ;$returnProperties = "To,HasCoverSheet" $sort = "" $flagIncludeSubfolders = 1 $flagRow1containheadings = 2 $flagOnlyReturnCount = 4 $flags = $flagIncludeSubfolders $aItems = _OL_ItemFind($oOutlook,$Folder,$objectClass,$Filter,$searchName,$searchValue,$returnProperties,$sort,$flags) _OL_Close($oOutlook) C:PROGRA~2AutoIt3IncludeoutlookEX.au3 (2788) : ==> Object referenced outside a "With" statement.: $aItems[$iCounter][$iIndex - 1] = $oItem.ItemProperties.Item($aReturnProperties[$iIndex]).value $aItems[$iCounter][$iIndex - 1] = $oItem.ItemProperties.Item($aReturnProperties[$iIndex])^ ERROR Just in case anyone wants to know what MailItem.properties work on version 0.10.0.0 and Outlook 2013 Here is the list of working Actions AlternateRecipientAllowed Application Attachments AutoForwarded AutoResolvedWinner BCC BillingInformation Body BodyFormat Categories CC Class Companies Conflicts ConversationIndex CreationTime DeferredDeliveryTime DeleteAfterSubmit DownloadState EntryID ExpiryTime FlagRequest FormDescription GetInspector HTMLBody Importance InternetCodepage IsConflict ItemProperties LastModificationTime MarkForDownload MessageClass Mileage NoAging OriginatorDeliveryReportRequested OutlookInternalVersion OutlookVersion Parent Permission PermissionService ReceivedTime RecipientReassignmentProhibited Recipients ReminderOverrideDefault ReminderPlaySound ReminderSet ReminderSoundFile ReminderTime RemoteStatus ReplyRecipientNames ReplyRecipients Saved SaveSentMessageFolder SenderEmailAddress SenderEmailType SenderName Sensitivity Sent SentOn SentOnBehalfOfName Session Size Subject Submitted To UnRead UserProperties VotingOptions VotingResponse
-
Yeah, Tried to debug by putting consolewrite and _array_displays in to determine values but no bueno. Always get the error and never get any text written to console. Hope you can debug further than I. If so what IDE are you using and what was the process you follow? Always looking to improve upon my technique.
-
I'm getting an error when running this to find items. If I change the ReturnProperties from "To" to "To,CC" there is no error $oOutlook = _OL_Open() $aItems = _OL_ItemFind($oOutlook,"*",$olMail,"","","","To","",1) C:PROGRA~2AutoIt3IncludeoutlookEX.au3 (5923) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: If UBound($avArrayTarget, 0) > 1 Then $avArrayTarget[0][1] = UBound($avArrayTarget, 2) If UBound($avArrayTarget, 0) > 1 Then ^ ERROR Autoit Version 3.3.8.1 OutlookEX Version 0.10.0.0
-
I'm getting an error when attempting to call a hash that doesn't exist. it appears that the code does not return 0 as it states in the function. (edit 10/23/2013) Well it's not that it fails on a call to an non-existent hash. It fails if you put a value on the parent. X('parent',value) x('parent.test) ----- this will throw the error. Here's the error: <filepath>multidemensionalassociativearray.au3 (51) : ==> Variable must be of type "Object".: ElseIf Not $cur.exists( $last_key ) Then ElseIf Not $cur^ ERROR Here's the Code To reproduce: I'm using the code from the original post. Most of the time edits are performed to that code so if i have to update it from an addtional post please let me know the number and i'll do so. Just in case here's the code from the original post as of 10.23.2013
-
Woot, that did it. Good call. Should this be a bug report?
-
ibigpapa reacted to a post in a topic: RichEdit Udf SetFont
-
I've got an issue and I'm not sure if it's a bug or if I'm doing something incorrectly. I'm making a richedit tool for my script. When I choose to change the font and I have text selected it'll change the selected text but then the selected text highlight is gone and cannot be seen until changing something like the font size. It's weird, it is still selecting the text but you cannot see what you have selected. To recreate follow these steps: 1. Run the code 2. Type some text 3. Highlight the text 4. Change the font. 5. click back on the edit to see the highlighted text 6. Attempt to highlight anything in the edit field (should see the issue now) 7. Change the font size 8. Now you'll see your selection again and what was selected will have changed. #include <Color.au3> #include <GuiRichEdit.au3> #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <RichEditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> AutoItSetOption("GUIOnEventMode",1) #region Main Global $iLeft = 5 Global $iTop = 20 Global $iWidth = 780 Global $iHeight = 575 Global $iFieldWidthLong = 100 Global $iFieldWidthMid = 50 Global $iFieldWidthShort = 25 Global $iDefaultHeight = 25 Global $iDefaultGap = 5 Global $guiTest = GUICreate("Test",800,600) Global $cboFont = GUICtrlCreateCombo("", $iLeft, $iTop, $iFieldWidthLong, $iDefaultHeight,BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetData($cboFont,"Arial|Arial Black|Comic Sans MS|Courier|Courier New|Estrangelo Edessa|Franklin Gothic Medium|Gautami|Impact|Latha|Lucida Console|Lucida Sans Console|Lucida Sans Unicode|Marlett|Modern|MS Sans Serif|MS Serif|MV Boli|Palatino Linotype|Roman|Script|Small Fonts|Symbol|Tahoma|Times New Roman|Trebuchet|Tunga|Verdana|Wingdings","Times New Roman") GUICtrlSetOnEvent($cboFont,"_fontChange") Global $cboFontSize = GUICtrlCreateCombo("", _getPositionLeftOfCtrl($guiTest, $cboFont, $iDefaultGap), $iTop, $iFieldWidthMid, $iDefaultHeight,BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetData($cboFontSize,"8|9|10|11|12|14|16|20|24|32|48|64|72","12") GUICtrlSetOnEvent($cboFontSize,"_fontSizeChange") Global $rhcBody = _GUICtrlRichEdit_Create($guiTest, "", $iLeft, $iTop + $iDefaultHeight + $iDefaultGap, $iWidth, $iHeight - $iDefaultHeight - $iDefaultGap, BitOR($WS_HSCROLL, $WS_VSCROLL, $ES_MULTILINE, $ES_WANTRETURN)) Global $bUndo = _GUICtrlRichEdit_SetUndoLimit($rhcBody, 1000) _GUICtrlRichEdit_SetFont($rhcBody,_getcboFontSize(),_getcboFont()) GUISetOnEvent($GUI_EVENT_CLOSE, "guiClose",$guiTest) GUISetState(@SW_SHOW,$guiTest) While 1 WEnd #endregion Main Func _fontChange() Local $avFontInfo = _GUICtrlRichEdit_GetFont($rhcBody) _GUICtrlRichEdit_SetFont($rhcBody,$avFontInfo[0],_getcboFont()) EndFunc Func _fontSizeChange() _GUICtrlRichEdit_SetFont($rhcBody,_getcboFontSize()) EndFunc Func guiClose() _GUICtrlRichEdit_Destroy($rhcBody) Exit EndFunc Func _getPositionLeftOfCtrl($hWin,$hCtrl,$iGap) Local $aiCoord = ControlGetPos($hWin,"",$hCtrl) Return $aiCoord[0] + $aiCoord[2] + $iGap EndFunc Func _getcboFont() Return GUICtrlRead($cboFont) EndFunc Func _getcboFontSize() Return GUICtrlRead($cboFontSize) EndFunc
-
Hello, I'm attempting to create an application that will kill services and start them. I am successfully able to get the output as long as the net command works. I run that same command again to cause the net utility to error and now it writes it's output to the console of sciTE...? I've tried including the error. When i do that i not only do not get a msgbox, i also see nothing in the sciTE console. Obviously a workaround would be to query the service with the SC utility. I'm curious to why this is not working. I'm probably missing a step somewhere. Well without further delay here's the code in all of its glory. #include <Constants.au3> Local $serviceCmd = Run(@ComSpec & " /c net start spooler", @SystemDir, @SW_HIDE, $STDOUT_CHILD) Local $line = "" While ProcessExists($serviceCmd) $line = "" $line = StdoutRead($serviceCmd) if StringInStr($line,"Service",2) > 0 Then MsgBox(0,"",$line) ExitLoop EndIf Wend
-
I have been attempting to figure out to detect a msgbox popup from a java script. the popup is random so unfortunately until i have the titles of all the different popup the title will not work. I am launching the web page using the _iecreate utility. the popups do not allow the page to be touched until dealt with. These popups appear to look like windows popup information/error/misc popups. I know they are generated by the java script. Another limitation to the assistance with this is the site is an internal site at work. Therefor no external access. Another issue with the popups are i launch the window hidden and the popups are visible. Any help with this would be great thanks!
-
Melba23 YOU DA MAN! that makes 2 times you've helped me. is there a way to say you did it again! a point system or something.
-
I've got an issue when i add a tab. It adds it successfully. When you switch to the tab if you click one of the edit boxes it pulls information in from best i guess is the first tab. You switch tabs and switch back that information is gone. You can also bypass this by selecting the newly created tab and switching back to another then back to the new tab and it works as it is supposed to. Please help with this goofied issue. #include <TabConstants.au3> #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <GuiEdit.au3> #include <WindowsConstants.au3> #include <GuiConstants.au3> #include <GuiTab.au3> AutoItSetOption("MustDeclareVars",1) AutoItSetOption("GUICoordMode",2) Global CONST $BUTTON_VARIABLE_ARRAY_SIZE = 10 Global CONST $CTRL_TAB_TEMPLATE_ARRAY2_SIZE = 9 Global CONST $EMAIL_TEMPLATE_ARRAY2_SIZE = 3 Global $emailTemplateArray[1][$EMAIL_TEMPLATE_ARRAY2_SIZE] $emailTemplateArray[0][0] = 0 Global $emailTemplateVariables[$BUTTON_VARIABLE_ARRAY_SIZE] $emailTemplateVariables[0] = $BUTTON_VARIABLE_ARRAY_SIZE - 1 $emailTemplateVariables[1] = "test var" $emailTemplateVariables[2] = "test var2" $emailTemplateVariables[3] = "test var3" $emailTemplateVariables[4] = "test var4" $emailTemplateVariables[5] = "test var5" $emailTemplateVariables[6] = "test var6" $emailTemplateVariables[7] = "test var7" $emailTemplateVariables[8] = "test var8" $emailTemplateVariables[9] = "test var9" _add_Email_Template_Array($emailTemplateArray,"test_button&1","test_subject1","test_body1") _add_Email_Template_Array($emailTemplateArray,"test_button&2","test_subject2","test_body2") _add_Email_Template_Array($emailTemplateArray,"test_button&2","test_subject2","test_body2") EmailTemplateGui() Func EmailTemplateGui() AutoItSetOption("GUICoordMode",1) Local $ctrlTabTemplate[$emailTemplateArray[0][0]+1][$CTRL_TAB_TEMPLATE_ARRAY2_SIZE] Local $x Local $msg Local $hData Local $loopControl Local $renameData Local $tempEmailTemplateArray[$emailTemplateArray[0][0]+1][$EMAIL_TEMPLATE_ARRAY2_SIZE] $tempEmailTemplateArray = $emailTemplateArray GUICreate("Email Templates",480,630) $ctrlTabTemplate[0][0] = $tempEmailTemplateArray[0][0] $ctrlTabTemplate[0][1] = GUICtrlCreateTab(5,5,470,595) For $x = 1 To $tempEmailTemplateArray[0][0] $ctrlTabTemplate[$x][0] = GUICtrlCreateTabItem($tempEmailTemplateArray[$x][0]) $ctrlTabTemplate[$x][1] = GUICtrlCreateLabel("Subject",15,35,50,20) $ctrlTabTemplate[$x][2] = GUICtrlCreateEdit($tempEmailTemplateArray[$x][1],15,55,450,35,BitOR($__EDITCONSTANT_WS_HSCROLL,$ES_AUTOHSCROLL)) $ctrlTabTemplate[$x][3] = GUICtrlCreateLabel("Body",15,100,50,20) $ctrlTabTemplate[$x][4] = GUICtrlCreateEdit($tempEmailTemplateArray[$x][2],15,120,450,450) $ctrlTabTemplate[$x][5] = GUICtrlCreateButton("Reset",415,35,50,20) $ctrlTabTemplate[$x][6] = GUICtrlCreateButton("Reset",415,100,50,20) $ctrlTabTemplate[$x][7] = GUICtrlCreateButton("Rename",15,570,50,20) $ctrlTabTemplate[$x][8] = GUICtrlCreateButton("Remove",70,570,50,20) Next GUICtrlCreateTabItem("") $ctrlTabTemplate[0][2] = GUICtrlCreateButton("Add",5,605,30,20) $ctrlTabTemplate[0][3] = GUICtrlCreateButton("Save and Exit",295,605,75,20) $ctrlTabTemplate[0][4] = GUICtrlCreateButton("Exit Do NOT Save",375,605,100,20) GUISetState() $loopControl = -99999 While $loopControl = -99999 $msg = GUIGetMsg() ;exit do not save button or x at top if $msg = $ctrlTabTemplate[0][4] Or $msg = $GUI_EVENT_CLOSE then for $x = 1 To $ctrlTabTemplate[0][0] if UBound($tempEmailTemplateArray) <> UBound($emailTemplateArray) or UBound($tempEmailTemplateArray,2) <> UBound($emailTemplateArray,2) or $tempEmailTemplateArray[$x][1] <> GUICtrlRead($ctrlTabTemplate[$x][2]) or $tempEmailTemplateArray[$x][2] <> GUICtrlRead($ctrlTabTemplate[$x][4]) Or $tempEmailTemplateArray[$x][0] <> _GUICtrlTab_GetItemText($ctrlTabTemplate[0][1], $x-1) Then if MsgBox(36,"Are you sure?","Are you sure you wish to exit without saving changes?") = 6 Then $loopControl +=1 ExitLoop Else ExitLoop EndIf Else $loopControl +=1 ExitLoop EndIf Next EndIf select case $msg = $ctrlTabTemplate[0][2] ;add button $renameData = InputBox("Add Email Template","Please enter the name you wish to name this email template." & @CRLF & "This name will also be used for the button on the email choices." & @CRLF & "If you wish to have an alt key option for the button use the && before the letter") If $renameData <> "" then _email_tab_add($ctrlTabTemplate,$renameData) _add_Email_Template_Array($tempEmailTemplateArray,$renameData & "_ADDED") ;work around $renameData = GUICtrlRead($ctrlTabTemplate[0][1]) ;_GUICtrlTab_SetCurFocus($ctrlTabTemplate[0][1],$ctrlTabTemplate[0][0]) ;_GUICtrlTab_SetCurFocus($ctrlTabTemplate[0][1],$renameData) ;switch to the one just created ;switch back to previous tab EndIf case $msg = $ctrlTabTemplate[0][3] ;Save and exit EndSelect For $x = 1 to $ctrlTabTemplate[0][0] $hData = GUICtrlRead($ctrlTabTemplate[$x][2]) if StringInStr($hData,".var",2) > 0 Then GUICtrlSetData($ctrlTabTemplate[$x][2],StringReplace($hData,".var",insertVariable())) EndIf $hData = GUICtrlRead($ctrlTabTemplate[$x][4]) if StringInStr($hData,".var",2) > 0 Then GUICtrlSetData($ctrlTabTemplate[$x][4],StringReplace($hData,".var",insertVariable())) EndIf Switch $msg case $ctrlTabTemplate[$x][5] ;subject reset GUICtrlSetData($ctrlTabTemplate[$x][2],$tempEmailTemplateArray[$x][1]) Case $ctrlTabTemplate[$x][6] ;body reset GUICtrlSetData($ctrlTabTemplate[$x][4],$tempEmailTemplateArray[$x][2]) Case $ctrlTabTemplate[$x][7] ;rename $renameData = InputBox("Rename Email Template","Please enter the name you wish to rename this email template to." & @CRLF & "This name will also be used for the button on the email choices." & @CRLF & "If you wish to have an alt key option for the button use the && before the letter") If $renameData <> "" then GUICtrlSetData($ctrlTabTemplate[$x][0],$renameData) EndIf Case $ctrlTabTemplate[$x][8] ;remove _remove_Email_Template_Array($tempEmailTemplateArray,$x) _email_tab_remove($ctrlTabTemplate,$x) ExitLoop EndSwitch Next if $ctrlTabTemplate[0][0] = 1 Then if Not(GUICtrlGetState($ctrlTabTemplate[1][8]) - 128 >= 0) Then GUICtrlSetState($ctrlTabTemplate[1][8],$GUI_DISABLE) EndIf Else if GUICtrlGetState($ctrlTabTemplate[1][8]) - 128 >= 0 Then GUICtrlSetState($ctrlTabTemplate[1][8],$GUI_ENABLE) EndIf EndIf WEnd GUISetState(@SW_HIDE) AutoItSetOption("GUICoordMode",2) EndFunc Func _add_Email_Template_Array(ByRef $array,$name,$subject = "",$body = "") $array[0][0] += 1 ReDim $array[$array[0][0]+1][3] $array[$array[0][0]][0] = $name $array[$array[0][0]][1] = $subject $array[$array[0][0]][2] = $body EndFunc Func insertVariable() local $varsCtrl[$BUTTON_VARIABLE_ARRAY_SIZE] Local $x Local $result Local $hResult $varsCtrl[0] = GUICreate("Variable Selection",100,20 * ($emailTemplateVariables[0] + 2)) For $x =1 To $emailTemplateVariables[0] $varsCtrl[$x] = GUICtrlCreateButton($emailTemplateVariables[$x],10,20 * $x,80,20) Next GUISetState() $result = "-99999" While $result = "-99999" $hResult = GUIGetMsg() if $hResult = $GUI_EVENT_CLOSE Then $result = "" ExitLoop EndIf For $x = 1 to $emailTemplateVariables[0] if $hResult = $varsCtrl[$x] Then $result = "[" & $emailTemplateVariables[$x] & "]" ExitLoop EndIf Next WEnd GUISetState(@SW_HIDE) Return $result EndFunc Func _email_tab_add(ByRef $array, $tabName, $subjectText = "", $bodyText = "") $array[0][0] += 1 ReDim $array[$array[0][0]+1][$CTRL_TAB_TEMPLATE_ARRAY2_SIZE] $array[$array[0][0]][0] = GUICtrlCreateTabItem($tabName) $array[$array[0][0]][1] = GUICtrlCreateLabel("Subject",15,35,50,20) $array[$array[0][0]][2] = GUICtrlCreateEdit($subjectText,15,55,450,35,BitOR($__EDITCONSTANT_WS_HSCROLL,$ES_AUTOHSCROLL)) $array[$array[0][0]][3] = GUICtrlCreateLabel("Body",15,100,50,20) $array[$array[0][0]][4] = GUICtrlCreateEdit($bodyText,15,120,450,450) $array[$array[0][0]][5] = GUICtrlCreateButton("Reset",415,35,50,20) $array[$array[0][0]][6] = GUICtrlCreateButton("Reset",415,100,50,20) $array[$array[0][0]][7] = GUICtrlCreateButton("Rename",15,570,50,20) $array[$array[0][0]][8] = GUICtrlCreateButton("Remove",70,570,50,20) EndFunc Func _email_tab_remove(ByRef $array,$index) Local $x Local $xx for $x = $CTRL_TAB_TEMPLATE_ARRAY2_SIZE-1 to 0 Step -1 GUICtrlDelete($array[$index][$x]) Next if $array[0][0] <> $index Then for $x = $index to $array[0][0]-1 for $xx =0 to $CTRL_TAB_TEMPLATE_ARRAY2_SIZE-1 $array[$x][$xx] = $array[$x+1][$xx] Next Next EndIf ReDim $array[$array[0][0]][$CTRL_TAB_TEMPLATE_ARRAY2_SIZE] $array[0][0] -= 1 EndFunc Func _remove_Email_Template_Array(ByRef $array, $index) Local $x Local $xx if $array[0][0] <> $index Then for $x = 1 to $array[0][0]-1 For $xx = 0 to $EMAIL_TEMPLATE_ARRAY2_SIZE-1 $array[$x][$xx] = $array[$x+1][$xx] Next Next EndIf ReDim $array[$array[0][0]][$EMAIL_TEMPLATE_ARRAY2_SIZE] $array[0][0] -= 1 EndFunc
-
Thank you BOTH!!! that worked. I've been trying to figure it out for better part of an hour.
-
What is supposed to happen is when you check a box it is supposed to change the Close button text to Save. The code only works when I put a message box in there to read the button odd yes. Working code is the bottom code block. The only difference between the 2 code blocks is this one line " MsgBox(0,"",GUICtrlRead($actionButton))". Maybe, i'm going about this in the wrong fashion. Any help would be appreciated. non working code #include <GUIConstantsEx.au3> UserPerfs() Func UserPerfs() ; gui for user preferences CONST $DEFAULT_EMAIL_HOT_KEY = "^!e" CONST $DEFAULT_EMAIL_HOT_KEY_DEFINITION = "! = ALT + = SHIFT ^ = CTRL # = WINKEY" dim $defaultTechLabel dim $defaultTechChkbox dim $nonDefaultTechLabel dim $nonDefaultTechInput dim $userPrefResult dim $defaultTechChkboxState dim $DefaultEmailHotKeyLabel dim $defaultEmailHotKeyChkbox dim $defaultEmailHotKeyChkboxState dim $nonDefaultEmailHotKeyLabel dim $nonDefaultEmailHotKeyInput dim $actionButton dim $cancelButton Opt("GUICoordMode", 2) GUICreate("Preferences") $defaultTechChkbox = GUICtrlCreateCheckbox("Use Non-Default Technician Name",5,5,200,20) $nonDefaultTechLabel = GUICtrlCreateLabel("Current Technician Name",-1,0,175,20) $nonDefaultTechInput = GUICtrlCreateInput(getLoggedIn(),-1,0,175,20) $defaultEmailHotKeyChkbox = GUICtrlCreateCheckbox("Use Non-Default Hot Key",-1,0,175,20) $nonDefaultEmailHotKeyLabel = GUICtrlCreateLabel("Hot Key",-1,0,50,20) GUICtrlCreateLabel("Use these values to combine keys: " & $DEFAULT_EMAIL_HOT_KEY_DEFINITION,-1,0,400,20) GUICtrlCreateLabel("EX: ^!e = CTRL+ALT+e",-1,0,150,20) $nonDefaultEmailHotKeyInput = GUICtrlCreateInput($DEFAULT_EMAIL_HOT_KEY,-1,0,175,20) $actionButton = GUICtrlCreateButton("Close",-1,0,50,20) $cancelButton = GUICtrlCreateButton("Cancel",0,-1,50,20) GUICtrlSetState($nonDefaultTechInput,$GUI_DISABLE) GUICtrlSetState($nonDefaultEmailHotKeyInput,$GUI_DISABLE) GUISetState() While 1 $userPrefResult = GUIGetMsg() $defaultTechChkboxState = GUICtrlRead($defaultTechChkbox) $defaultEmailHotKeyChkboxState = GUICtrlRead($defaultEmailHotKeyChkbox) if $defaultTechChkboxState = $GUI_CHECKED then ;set tech input to enabled if GUICtrlGetState($nonDefaultTechInput) - 128 >= 0 Then GUICtrlSetState($nonDefaultTechInput,$GUI_ENABLE) EndIf if GUICtrlRead($actionButton) = "close" Then GUICtrlSetData($actionButton,"save") EndIf Else ;set tech input to disabled if Not(GUICtrlGetState($nonDefaultTechInput) - 128 >= 0) Then GUICtrlSetData ($nonDefaultTechInput,getLoggedIn()) GUICtrlSetState($nonDefaultTechInput,$GUI_DISABLE) EndIf EndIf if $defaultEmailHotKeyChkboxState = $GUI_CHECKED then ;set tech input to enabled if GUICtrlGetState($nonDefaultEmailHotKeyInput) - 128 >= 0 Then GUICtrlSetState($nonDefaultEmailHotKeyInput,$GUI_ENABLE) EndIf if GUICtrlRead($actionButton) = "close" Then GUICtrlSetData($actionButton,"save") EndIf Else ;set tech input to disabled if Not(GUICtrlGetState($nonDefaultEmailHotKeyInput) - 128 >= 0) Then GUICtrlSetData ($nonDefaultEmailHotKeyInput,$DEFAULT_EMAIL_HOT_KEY) GUICtrlSetState($nonDefaultEmailHotKeyInput,$GUI_DISABLE) EndIf EndIf if $defaultEmailHotKeyChkbox <> $GUI_CHECKED and $defaultTechChkbox <> $GUI_CHECKED Then if GUICtrlRead($actionButton) = "save" Then GUICtrlSetData($actionButton,"close") EndIf EndIf Select case $userPrefResult = -3 Return Case $userPrefResult = $actionButton case $userPrefResult = $cancelButton Return EndSelect WEnd EndFunc Func getLoggedIn() Dim $wshNetwork Dim $userName Dim $userNameArray $wshNetwork = ObjCreate("WScript.Network") $userName = $wshNetwork.UserName $userName = StringReplace($userName, "_", " ") $userNameArray = StringSplit($userName, " ", 2) $userName = "" For $word In $userNameArray $userName &= firstCapRestLowWord($word) & " " Next Return StringStripWS($userName, 3) EndFunc ;==>getLoggedIn Func firstCapRestLowWord($WordToChange) ;~converts a word to the format of the first letter caplitalized and rest lower case ex. TROY = Troy or TrOy = Troy or troy = Troy Dim $first Dim $rest If StringLen($WordToChange) > 1 Then $first = StringMid($WordToChange, 1, 1) $rest = StringMid($WordToChange, 2) Else $first = $WordToChange $rest = "" EndIf $first = StringUpper($first) $rest = StringLower($rest) Return StringStripWS($first & $rest, 3) EndFunc ;==>firstCapRestLowWord working code #include <GUIConstantsEx.au3> UserPerfs() Func UserPerfs() ; gui for user preferences CONST $DEFAULT_EMAIL_HOT_KEY = "^!e" CONST $DEFAULT_EMAIL_HOT_KEY_DEFINITION = "! = ALT + = SHIFT ^ = CTRL # = WINKEY" dim $defaultTechLabel dim $defaultTechChkbox dim $nonDefaultTechLabel dim $nonDefaultTechInput dim $userPrefResult dim $defaultTechChkboxState dim $DefaultEmailHotKeyLabel dim $defaultEmailHotKeyChkbox dim $defaultEmailHotKeyChkboxState dim $nonDefaultEmailHotKeyLabel dim $nonDefaultEmailHotKeyInput dim $actionButton dim $cancelButton Opt("GUICoordMode", 2) GUICreate("Preferences") $defaultTechChkbox = GUICtrlCreateCheckbox("Use Non-Default Technician Name",5,5,200,20) $nonDefaultTechLabel = GUICtrlCreateLabel("Current Technician Name",-1,0,175,20) $nonDefaultTechInput = GUICtrlCreateInput(getLoggedIn(),-1,0,175,20) $defaultEmailHotKeyChkbox = GUICtrlCreateCheckbox("Use Non-Default Hot Key",-1,0,175,20) $nonDefaultEmailHotKeyLabel = GUICtrlCreateLabel("Hot Key",-1,0,50,20) GUICtrlCreateLabel("Use these values to combine keys: " & $DEFAULT_EMAIL_HOT_KEY_DEFINITION,-1,0,400,20) GUICtrlCreateLabel("EX: ^!e = CTRL+ALT+e",-1,0,150,20) $nonDefaultEmailHotKeyInput = GUICtrlCreateInput($DEFAULT_EMAIL_HOT_KEY,-1,0,175,20) $actionButton = GUICtrlCreateButton("Close",-1,0,50,20) $cancelButton = GUICtrlCreateButton("Cancel",0,-1,50,20) GUICtrlSetState($nonDefaultTechInput,$GUI_DISABLE) GUICtrlSetState($nonDefaultEmailHotKeyInput,$GUI_DISABLE) GUISetState() While 1 $userPrefResult = GUIGetMsg() $defaultTechChkboxState = GUICtrlRead($defaultTechChkbox) $defaultEmailHotKeyChkboxState = GUICtrlRead($defaultEmailHotKeyChkbox) if $defaultTechChkboxState = $GUI_CHECKED then ;set tech input to enabled if GUICtrlGetState($nonDefaultTechInput) - 128 >= 0 Then GUICtrlSetState($nonDefaultTechInput,$GUI_ENABLE) EndIf if GUICtrlRead($actionButton) = "close" Then GUICtrlSetData($actionButton,"save") EndIf Else ;set tech input to disabled if Not(GUICtrlGetState($nonDefaultTechInput) - 128 >= 0) Then GUICtrlSetData ($nonDefaultTechInput,getLoggedIn()) GUICtrlSetState($nonDefaultTechInput,$GUI_DISABLE) EndIf EndIf if $defaultEmailHotKeyChkboxState = $GUI_CHECKED then ;set tech input to enabled if GUICtrlGetState($nonDefaultEmailHotKeyInput) - 128 >= 0 Then GUICtrlSetState($nonDefaultEmailHotKeyInput,$GUI_ENABLE) EndIf if GUICtrlRead($actionButton) = "close" Then GUICtrlSetData($actionButton,"save") EndIf Else ;set tech input to disabled if Not(GUICtrlGetState($nonDefaultEmailHotKeyInput) - 128 >= 0) Then GUICtrlSetData ($nonDefaultEmailHotKeyInput,$DEFAULT_EMAIL_HOT_KEY) GUICtrlSetState($nonDefaultEmailHotKeyInput,$GUI_DISABLE) EndIf EndIf MsgBox(0,"",GUICtrlRead($actionButton)) if $defaultEmailHotKeyChkbox <> $GUI_CHECKED and $defaultTechChkbox <> $GUI_CHECKED Then if GUICtrlRead($actionButton) = "save" Then GUICtrlSetData($actionButton,"close") EndIf EndIf Select case $userPrefResult = -3 Return Case $userPrefResult = $actionButton case $userPrefResult = $cancelButton Return EndSelect WEnd EndFunc Func getLoggedIn() Dim $wshNetwork Dim $userName Dim $userNameArray $wshNetwork = ObjCreate("WScript.Network") $userName = $wshNetwork.UserName $userName = StringReplace($userName, "_", " ") $userNameArray = StringSplit($userName, " ", 2) $userName = "" For $word In $userNameArray $userName &= firstCapRestLowWord($word) & " " Next Return StringStripWS($userName, 3) EndFunc ;==>getLoggedIn Func firstCapRestLowWord($WordToChange) ;~converts a word to the format of the first letter caplitalized and rest lower case ex. TROY = Troy or TrOy = Troy or troy = Troy Dim $first Dim $rest If StringLen($WordToChange) > 1 Then $first = StringMid($WordToChange, 1, 1) $rest = StringMid($WordToChange, 2) Else $first = $WordToChange $rest = "" EndIf $first = StringUpper($first) $rest = StringLower($rest) Return StringStripWS($first & $rest, 3) EndFunc ;==>firstCapRestLowWord
-
THANKS!!! that's it.
-
when i use the outlook object in vb to create an email it works great. well now i'm moving my vb script into auto it. Here is the vb snippet Set OutlookApp = createobject("Outlook.Application") Set OutlookMailItem = OutlookApp.CreateItem(olMailItem) so in auto it i do $outlookApp = objcreate("outlook.application") $outlookMailItem = $outlookApp.createitem(olmailitem) autoit barfs at the create item on the second line. I'm probably calling it incorrectly. Any help would be great.