Thursday, November 1, 2012

Oops... forgot to attach

Here's a quick and easy way to avoid forgetting that attachment when sending an e-mail in Outlook.

(Adapted slightly from Mark Bird's blog.)

In Outlook 2010:
  • Click on File > Options > Trust Center > Trust Center Settings > Macro Settings > Enable all macros (read the warning first)
  • Click OK twice to save options
  • Press Alt-F11
  • Expand the project tree on the left, and double-click "ThisOutlookSession"
  • Click in the right-hand pane, and paste in the code below
  • Restart Outlook again (saving changes when prompted)
You'll now get a polite message if you mention "attach" or any variation in an e-mail, but forget to attach. It's clever enough to ignore the e-mail trail.

 
Here's the code to paste in:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim m As Variant
Dim strBody As String
Dim intIn As Long
Dim intAttachCount As Integer, intStandardAttachCount As Integer

On Error GoTo handleError

'Edit the following line if you have a signature on your email that includes images or other files. Make intStandardAttachCount equal the number of files in your signature.
intStandardAttachCount = 0

strBody = LCase(Item.Body)

' text-only reply?
intIn = InStr(1, strBody, "original message")
If intIn = 0 Then

    ' html reply?
    intIn = InStr(1, strBody, "from: ")
    If intIn = 0 Then intIn = Len(strBody)

Else
    intIn = Len(strBody)
End If

intIn = InStr(1, Left(strBody, intIn), "attach")

intAttachCount = Item.Attachments.Count

If intIn > 0 And intAttachCount <= intStandardAttachCount Then
    
    m = MsgBox("It appears that you mean to send an attachment," & vbCrLf & "but there is no attachment to this message." & vbCrLf & vbCrLf & "Do you still want to send?", vbQuestion + vbYesNo + vbMsgBoxSetForeground)

    If m = vbNo Then Cancel = True
    
End If

handleError:

If Err.Number <> 0 Then
    MsgBox "Outlook Attachment Reminder Error: " & Err.Description, vbExclamation, "Outlook Attachment Reminder Error"
End If

End Sub

Thursday, June 21, 2012

iTunes and the scary "connection was reset" error

Sometimes I'm reminded why people are afraid of computers.

This morning I tried to turn on Genius in iTunes, and was confronted with a "network connection was reset" message. Helpful Apple, very helpful.

a bit like this one, but less info

From the Apple forums, it looks like a common fix is to sign out of iTunes and back in again (who'd have thought). I tried this, and got the same error trying to sign into my iTunes account.

Brilliant.

Some more Googling later, and it looks like the problem might be caused by my router’s DNS settings. What the f@#k is going on?

Ok, I’ll try pointing my router at a public DNS server. Logging into my Thomson Gateway ST585 router, it doesn't look like I can do this through the fluffy web interface. Thanks PlusNet, thanks a lot.

More Googling, and I’m told I need to spin up telnet to configure my DNS settings. This isn't the sort of thing your Gran could do while watching an episode of Murder, She Wrote*.

why the fuck do I need telnet to do this

Magically, everything now worked in iTunes-land.

I don't know what to think of all this, apart from concluding that:

  1. Software will always be complex (even if it seems like we are being shielded from this)
  2. Users can never be fully protected from the intricate mess that lies beneath a pretty interface.

On the plus side, there will always be a job for technical support staff. And what else was I going to do this morning?

* Apologies if your Gran is some kind of wiz with text-based terminal connections.