Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/02/2015 in all areas

  1. This works for me: #include <Word.au3> Global Const $wdActiveEndPageNumber = 3 $oWord = _Word_Create() $oDoc = _Word_DocOpen($oWord, "C:\temp\test.docx", False, Default, True) $oRange = _Word_DocFind($oDoc, "SLR 1985 PRO 3", 0, Default, True) If @error Then MsgBox(0, "", "Nothing found!") Else MsgBox(0, "", "Text found on page " & $oRange.Information($wdActiveEndPageNumber)) EndIf _Word_DocClose($oDoc) _Word_Quit($oWord) You do not need to work with a selection (means selecting the text in the GUI). Simply use the Range object (kind of an invisible selection) returned by _Word_DocFind.
    2 points
  2. ​Damn right you use Sublime Text I represented them for an award ceremony last year - because apparently I am (was?) the number 1 plugin contributor in the UK.
    2 points
  3. ; ;################################## ; Include ;################################## #Include<file.au3> ;################################## ; Variables ;################################## $SmtpServer = "MailServer" ; address for the smtp-server to use - REQUIRED $FromName = "Name" ; name from who the email was sent $FromAddress = "your@Email.Address.com" ; address from where the mail should come $ToAddress = "your@Email.Address.com" ; destination address of the email - REQUIRED $Subject = "Userinfo" ; subject from the email - can be anything you want it to be $Body = "" ; the messagebody from the mail - can be left blank but then you get a blank mail $AttachFiles = "" ; the file(s) you want to attach seperated with a ; (Semicolon) - leave blank if not needed $CcAddress = "CCadress1@test.com" ; address for cc - leave blank if not needed $BccAddress = "BCCadress1@test.com" ; address for bcc - leave blank if not needed $Importance = "Normal" ; Send message priority: "High", "Normal", "Low" $Username = "******" ; username for the account used from where the mail gets sent - REQUIRED $Password = "********" ; password for the account used from where the mail gets sent - REQUIRED $IPPort = 25 ; port used for sending the mail $ssl = 0 ; enables/disables secure socket layer sending - put to 1 if using httpS $tls = 0 ; enables/disables TLS when required ;~ $SmtpServer = "smtp.gmail.com" ; GMAIL address for the smtp-server to use - REQUIRED ;~ $IPPort=465 ; GMAIL port used for sending the mail ;~ $ssl=1 ; GMAIL enables/disables secure socket layer sending - put to 1 if using https ;~ $SmtpServer = "smtp.office365.com" ; O365 address for the smtp-server to use - REQUIRED ;~ $IPPort=25 ; O365 port used for sending the mail ;~ $ssl=1 ; O365 enables/disables secure socket layer sending - put to 1 if using https ;~ SmtpServer = "smtp.mail.yahoo.com" ; Yahoo address for the smtp-server to use - REQUIRED ;~ $IPPort = 465 ; Yahoo port used for sending the mail ;~ $ssl = 1 ; Yahoo enables/disables secure socket layer sending - put to 1 if using https ;################################## ; Script ;################################## Global $oMyRet[2] Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") $rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl, $tls) If @error Then MsgBox(0, "Error sending message", "Error code:" & @error & " Description:" & $rc) EndIf ; ; The UDF Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance="Normal", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0, $tls = 0) Local $objEmail = ObjCreate("CDO.Message") $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>' $objEmail.To = $s_ToAddress Local $i_Error = 0 Local $i_Error_desciption = "" If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress $objEmail.Subject = $s_Subject If StringInStr($as_Body, "<") And StringInStr($as_Body, ">") Then $objEmail.HTMLBody = $as_Body Else $objEmail.Textbody = $as_Body & @CRLF EndIf If $s_AttachFiles <> "" Then Local $S_Files2Attach = StringSplit($s_AttachFiles, ";") For $x = 1 To $S_Files2Attach[0] $S_Files2Attach[$x] = _PathFull($S_Files2Attach[$x]) ;~ ConsoleWrite('@@ Debug : $S_Files2Attach[$x] = ' & $S_Files2Attach[$x] & @LF & '>Error code: ' & @error & @LF) ;### Debug Console If FileExists($S_Files2Attach[$x]) Then ConsoleWrite('+> File attachment added: ' & $S_Files2Attach[$x] & @LF) $objEmail.AddAttachment($S_Files2Attach[$x]) Else ConsoleWrite('!> File not found to attach: ' & $S_Files2Attach[$x] & @LF) SetError(1) Return 0 EndIf Next EndIf $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer If Number($IPPort) = 0 then $IPPort = 25 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort ;Authenticated SMTP If $s_Username <> "" Then $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password EndIf ; Set security params If $ssl Then $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True If $tls Then $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendtls") = True ;Update settings $objEmail.Configuration.Fields.Update ; Set Email Importance Switch $s_Importance Case "High" $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "High" Case "Normal" $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Normal" Case "Low" $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Low" EndSwitch $objEmail.Fields.Update ; Sent the Message $objEmail.Send If @error Then SetError(2) Return $oMyRet[1] EndIf $objEmail="" EndFunc ;==>_INetSmtpMailCom ; ; ; Com Error Handler Func MyErrFunc() $HexNumber = Hex($oMyError.number, 8) $oMyRet[0] = $HexNumber $oMyRet[1] = StringStripWS($oMyError.description, 3) ConsoleWrite("### COM Error ! Number: " & $HexNumber & " ScriptLine: " & $oMyError.scriptline & " Description:" & $oMyRet[1] & @LF) SetError(1); something to check for when this function returns Return EndFunc ;==>MyErrFunc Edit: Fixed Bcc ... Edit: Added support for different port and SLL which are used by GMail (Port 465) Edit: Added Importance support (10/2008) EDIT: Added $TLS option (07/2020 Some interesting Info from the thread:
    1 point
  4. http://techcrunch.com/2015/04/29/microsoft-shocks-the-world-with-visual-studio-code-a-free-code-editor-for-os-x-linux-and-windows/#.yabcl7:Pdlo This is really interesting, I love the direction Microsoft are moving in. When the switch is flipped you shouldn't be able to download from http://code.visualstudio.com
    1 point
  5. or this one $dStrings = '[dshow @ 02b85e40] DirectShow video devices' & @CRLF & _ '[dshow @ 02b85e40] "CyberLink Webcam Splitter"' & @CRLF & _ '[dshow @ 02b85e40] "USB Video Device"' & @CRLF & _ '[dshow @ 02b85e40] "IP Camera [JPEG/MJPEG]"' & @CRLF & _ '[dshow @ 02b85e40] "DroidCam"' & @CRLF & _ '[dshow @ 02b85e40] DirectShow audio devices' & @CRLF & _ '[dshow @ 02b85e40] "USB Audio Device"' & @CRLF & _ '[dshow @ 02b85e40] "Realtek HD Audio Input"' $nV = "DirectShow video devices" $nA = "DirectShow audio devices" $dev = StringRegExp($dStrings, '(?s)(' & $nV & '.*)(' & $nA & '.*)', 3) $pattern = '(?m)(^[^"]+"?)|("(?=\R?))' msgbox(0, $nV, $nV &@crlf&@crlf& StringRegExpReplace($dev[0], $pattern , "")) msgbox(0, $nA, $nA &@crlf&@crlf& StringRegExpReplace($dev[1], $pattern , ""))
    1 point
  6. ​ lol i was only playing around. its not like it a big deal he he. i just hope that someone can help us both out.
    1 point
  7. ​This can be found on MSDN (Microsoft Developer Network). Excel Developer Reference for Excel 2010.
    1 point
  8. I like the multiplatform thing. I use sublime text at the mo because it's nice to use the same editor in my dev environment and on my mac.
    1 point
  9. i wasnt rushing you m8 just trying to get an idea which one to grab. Ill wait
    1 point
  10. jchd

    SQLite large input

    Fixed.
    1 point
  11. I have sent @argumentum an updated version on top of their updates with the follow changelog: v0.2 Added: Select all text in the edit control using Ctrl+A Changed: Select statement for message monitoring to Switch Changed: Tidied the indentation of ComposeCode() Changed: WMIDateStringToDate() to a regular expression version Changed: Naming convention of Array output function Fixed: Variable declared twice in ComposeCode() Fxed: HTML missing closing tags v0.1 You can delete after you have read: Changed: Chr(34) into a constant. Brings a slight speed increase Changed: Now the temp path is randomly generated Changed: Format for displaying the initial date and modified of the script Changed: Certain macros as Global constants. This results is a slight speed enhancement Changed: File extensions to lowercase counterparts Changed: HTML output is now valid HTML5 Changed: Chr(9) to @TAB Fixed: Incorrect spelling of Scriptomatic from Scriptometic Fixed: Using $MB_SYSTEMMODAL instead of previous values Fixed: Variable naming convention of output code Removed: Magic number usage and using readble constants Removed: Double lines Removed: Duplicate variables Removed: Unnecessary brackets around expressions
    1 point
  12. You don't even need the String() in there. See Nitekrams example.
    1 point
  13. Along with what BrewManNH suggested, with _ArrayToString you'll need to use a delimiter to put the string into the combo box to separate your values. Example: #include <Array.au3> #include <GUIConstants.au3> Local $aArray[20], $i, $hWnd, $cBox, $msg, $cButton For $i = 0 To 19 Step 1 $aArray[$i] = $i Next $hWnd = GUICreate("Array to string/ Combo test") $cBox = GUICtrlCreateCombo("", 5, 5) $cButton = GUICtrlCreateButton("populate combo box", 5, 30) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $cButton GUICtrlSetData($cBox, _ArrayToString($aArray, "|"), $aArray[0]) EndSwitch WEnd
    1 point
  14. Use _ArrayToString to convert the array to a delimited string and add that string to the combo box.
    1 point
  15. Non regex version: Func Convert2ms($sTime) Return StringLeft($sTime, 2) * 3600000 + StringMid($sTime, 4, 2) * 60000 + StringMid($sTime, 7, 2) * 1000 + StringRight($sTime, 2) EndFunc
    1 point
  16. @Mikell : just a small remark. You can remove your concatenation and juste keep the calculation : Func Convert2ms($sTime) Return Execute(StringRegExpReplace($sTime, "(\d+):(\d+):(\d+)\.(\d*)", "($1*3600+$2*60+$3)*1000+$4") ) EndFunc
    1 point
  17. This reminds me something Msgbox(0,"", Convert2ms("00:00:22.17") ) Func Convert2ms($sTime) ;format "HH:MM:SS.ms", no error / validity check for input! Return Execute("'" & StringRegExpReplace($sTime, "(\d+):(\d+):(\d+)\.(\d*)", _ "' & $1*3600*1000+$2*60*1000+$3*1000+$4 & '") & "'") EndFunc
    1 point
  18. Ace08

    Simple Database

    uhm hi guys this will be my first script that i will post in this forum and realy meassy, i'll still be cleaning this up but not today because im still participating on some bigger project, but right now what i need are your comments on how i can improve the script and its all because you guys helped me that i was able to finish this. Thank you som much for the help here is the exe i've made: DataBase.exe if anyone needs the script here it is but i warn you "realy meassy indeed" DataBase.au3 Edit: Oh almost forgot when you press delete and cancelled it will give you a message box "yo" forgot to edit that one before i post ehehe but anyways it'll be fixed when i'm back
    1 point
×
×
  • Create New...