Code Tidy - Pastebin

New     Fork     Embed     View raw     Report
Outlook message copy and clean - text

Embed

You can embed this paste into a blog or website with this code:

<iframe class="codetidy" type="text/html" width="100%" src="http://codetidy.com/paste/embed/1844" frameborder="0"></iframe>

Add comment

Captcha
  1. #UseHook On?
  2. ; paste all text into file and remove formatting?
  3. #a::?
  4.     ; Start off empty to allow ClipWait to detect when the text has arrived.?
  5.     clipboard =?
  6.     ; Move focus from Outlook message list to message?
  7.     Send, {TAB}?
  8.     Sleep, 300?
  9.     ; Select all?
  10.     Send, ^a?
  11.     ; Copy?
  12.     Send, ^{ins}?
  13.     ; Wait 0.5 seconds for the clipboard to contain text.?
  14.     ClipWait, 0?
  15.     /* Replace newlines and carriage returns with a space. Don't get cute and?
  16.     try to do it in one go - you'll regret it. */?
  17.     StringReplace, clipboardt, clipboard, `n, %A_Space%, All?
  18.     StringReplace, clipboardt, clipboardt, `r, %A_Space%, All?
  19.     ; Replace tabs with a space?
  20.     StringReplace, clipboardt, clipboardt, %A_Tab%, %A_Space%, All?
  21.     ; Replace consecutive spaces with a single space?
  22.     clipboardt := RegExReplace(clipboardt, "` {2,}", "` ")?
  23.     ; This has the effect of trimming leading and trailing whitespace?
  24.     clipboardt = %clipboardt%?
  25.     ; Add the nice clean line of text to your file of choice?
  26.     FileAppend, %clipboardt%`n, text_collect.txt?
  27.     clipboardt =?
  28.     ; Switch back to the message list?
  29.     Send, +{TAB}?
  30.     return?
  31. #UseHook Off?
© 2011 Code Tidy  Terms and conditions