Monday, April 19, 2010

Word: Show Me My Property

Word documents have many user-accessible properties, such as Author, Title, etc.  One can find them by clicking on the Word Button -> Prepare -> Properties.  These properties can also be accessed by a macro using the BuiltInDocumentProperties method.

This post will show you which properties are available and how to access them using macros.

Thursday, April 15, 2010

Back From the Future


Lou: You gonna order something, kid?
Marty McFly: Ah, yeah... Give me - Give me a Tab.
Lou: Tab? I can't give you a tab unless you order something.
Marty McFly: All right, give me a Pepsi Free.
Lou: You want a Pepsi, PAL, you're gonna pay for it.  

Here is a simple tip that can save a lot of time. If you click on a link in a PDF file, how to you go back to where you started?

The answer: Alt + Left arrow

Example: If you are on page 2  and you click a link that takes you to page 155, Alt + left arrow takes you back to page 2.

If you want to go back to the future, uh, I mean back to the page that you went to before, then use Alt + Right arrow.

Wednesday, April 14, 2010

Changing Weekend in Excel Workday

If you live somewhere where the weekend is on Friday and Saturday instead of Saturday and Sunday, here is a hack to the Excel Workday function to calculate the correct dates:

WORKDAY(K5+1,5)-1

where K5 holds the date. Just add 1 to the date and subtract 1 from the result.

[source here]

Preventing Emails with Blank Subject Lines in Outlook

Here is a nice fix to prevent Outlook from sending emails without anything in the subject:

Save yourself the annoyance by following the next steps.
  1. Open the Visual Basic Editor (in Outlook, press ALT+F11).
  2. On the left-hand side of the screen, expand the ‘Project1 (go into ‘Microsoft Office Outlook Objects’ -> ‘ThisOutlookSession’).
  3. Double click on ‘ThisOutlookSession’
  4. Paste the following lines of code in the right-hand pane of the screen:

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    If Item.Subject = "" Then
    Cancel = MsgBox("This message does not have a subject." & vbNewLine & "Do you wish to continue sending anyway?", vbYesNo + vbExclamation, "No Subject") = vbNo
    End If
End Sub

Save the project (‘File’ -> ‘Save’) and return to Outlook. From now on, the code will be called every time you press the send-button after you composed an email. Outlook will pop up a warning when you try sending an email with an empty subject line.

Monday, April 12, 2010

For Example, That Is...

I can never remember if I should use i.e. or e.g., so I am putting it on my blog so that I can find it fast.
  • i.e. means id est in Latin and "that is" in English
  • e.g. means exempli gratia in Latin and “for example” in English

Macros: Moving the Selection

I taught myself how to use macros (through lots of web searching and testing lots of bad code in Word), and therefore, there are some basics that were left out along the way.  Today's post is about one of those missing pieces: moving the selection.
Once something is selected, the selection can be changed by issuing a command with the following parameters:
  1. Move type
  2. Move unit
  3. Count
  4. Extend 

Sunday, April 11, 2010

Super Copyrights

Today I changed a term in one of my documents to use a fancy, new term which has a copyright.  For some reason (which I'll ignore for now) when I replaced the term, the copyright symbol was not put into superscript. So, macros to the rescue:

Sub copyrightToSuperscript()
'
' copyrightToSuperscript Macro
'
' Change all copyright symbols to superscript

Wednesday, April 7, 2010

The Future of Publishing

If you've got an extra 2 minutes and 26 seconds, this video is worth watching.  It is a little boring at the beginning, but watch it the whole way through.