Just Code : Using word spell check

Adding this snipit. came in helpfull today Dim TaskKill TaskKill = CreateObject(“WScript.Shell”).Run(“taskkill /f /im winword.exe”, 0, True) Dim oWord,x Set oWord = CreateObject(“Word.Application”) oWord.visible = true oWord.DisplayAlerts = false oWord.Documents.Add() x = oWord.CheckSpelling(“Carrrots”,,true,,,,,,,,,,) if ( x = false ) Then      debug.log(oWord.GetSpellingSuggestions(“Carrrots”).Item(1)) End if  

Here is some code to tabulate questions in PHP

  <?php // url to test : http://[server]/[VirtualDirectory]/TOM.php?q=d1&m=&f=d1.containsany({japan,china}) ini_set(‘display_errors’, 1); ini_set(‘display_startup_errors’, 1); error_reporting(E_ALL); if (isset($_GET[“q”]) && $_GET[“q”] != “”){ // d1*d3 or d1]d3 or d1+d3 $q = $_GET[“q”]; $q = str_replace(“]”,”+”,$q); echo $q; } else { die(“No Question Specified”); } if (isset($_GET[“m”]) && $_GET[“m”] != “”){ $m = “json”; } else { $m=”html”; } if … Read more

IBM Watson API Test

I have been meaning to post something like this code for a while. Here is an example of calling one of the IBM watson API’s from a MRS script.  Its just code and i think easy to understand. The full API i am playing with can be found here. https://cloud.ibm.com/apidocs/language-translator#translate Dim sUrl Dim http Dim … Read more

Just Code : Delete all files with specific month

I needed a quick bit of code today so that i could clean up my hard disk. This script will delete all the files that match a specific month number. One day it may save you a few minutes. LoopFolders(“D:\Servers\116\SQLBackups”,10) Sub LoopFolders(sFullPath,iMonth) Dim oFolder,oSubFolder,oFSO,oFile Set oFSO = CreateObject(“Scripting.FileSystemObject”) If oFSO.FolderExists(sFullPath) Then Set oFolder = oFSO.GetFolder(sFullPath) … Read more

Send SMTP Email via Gmail

Just helped someone get this sorted and thought i woulds share. The trick was to allow Less Secure apps in your account. Here is the link https://myaccount.google.com/lesssecureapps?pli=1 Turn it on and then just use the normal CDO code. Dim oEmail, sEmailFrom, sEmailTo, sEmailSubject, sEmailBody,sBCC ‘ Send email sEmailTo = “admin@SmarterDimensions.com” sEmailFrom = “FromAddress@SmarterDimensions.com” sEmailSubject = … Read more

JustCode : Remove a language from MDD via script

This example show us how to open up an MDD file in read-write mode and remove a langauge from it. ‘ **************************************** ‘ Designed by : Smarter Dimensions ‘ Last Updated : 26th September 2009 ‘ Open MDD file and remove language ‘ **************************************** Dim oMDM ‘ Create the MDM object and open the Short … Read more

JustCode : Connect to a Survey and find a record

This code will show you how to connect to a data collection survey and find a specific record. Once found the function will return the ID of the found record. This is the metadata Metadata(en-AU, Question, Label) ConnectionInfo “{Info}” info; Name “Name” text; End Metadata This is the Routing Routing(Web1) Dim oInfo Set oInfo = … Read more