You can construct a vertical 'centerline' on each of the rectangles and place the dimension on the centerlines.
To construct the centerlines, click insert>annotation>centerline, and select the 2 vertical edges of each rectangle.
You can delete the holes before or after, but before would probably be easiest and ensure the dimension didn't accidentally reference the holes.
As mention by Robert H. You can use centerlines.
Alternatively you can select smart dimenion tool and then right click on both horizontal lines and select "Select Midpoint" option. It will give similar results.
Centerlines is the easiest way to solve your task. Personally I prefer to use http://www.writingsmyessays.com/ for these purposes but a problem described is not that difficult to resolve on your own.