Skip to content

Instantly share code, notes, and snippets.

@ArneS
ArneS / RemovePatternFromAttachmentFilename
Last active August 29, 2015 14:10
Outook 2010 VBA macro to remove string patterns from filenames of attachments.
Sub RemovePatternFromAttachmentFilename()
Dim strPattern As String: strPattern = "^[0-9]{3,12}[_][0-9]{1,3}[ ]" ' Matches e.g. "123456_2 Example file.docx"
Dim strReplace As String: strReplace = ""
Dim regEx As New RegExp ' RegExp needs to be enabled. http://stackoverflow.com/questions/21139938/vba-regexp-causes-compile-error-while-vbscript-regexp-works
regEx.Pattern = strPattern
Dim message As Outlook.MailItem
Dim attac As Attachment
Dim i As Long
@ArneS
ArneS / Digit to unicode superscript
Created May 13, 2015 18:03
Javascript function to return unicode superscript digits. Handy for writing on html canvas
function digitToUnicodeSupercriptDigit(n) {
subst = [176,185,178,179,0x2074,0x2075,0x2076,0x2077,0x2078,0x2079]
return String.fromCharCode(subst[n]
}