Unfortunately this does not currently work since you also are required to pass in a rectangle to the Draw function at the same time but you can't pass in a rectangle size because you haven't calculated it yet...quite the vicious cycle and I'm hoping this will be (is maybe?) fixed in a future managed directX update.
Until then i know of two methods of calculating the length of your text, one is the one that I currently use but I just found out tonight that there is an error (that I've never noticed) in that extra pixels are thrown onto the end so I'm including a link to another solution that apparently addresses that issue (although I haven't tried it myself yet)
Method 1:
Public Function MeasureString(ByVal e As PaintEventArgs, ByVal stringToMeasure As String, ByVal font As System.Drawing.Font) As SizeF
Return e.Graphics.MeasureString(stringToMeasure, font)
End Function
So basically that function will return you the rectangle dimensions of your string (height and width)
but like I mentioned apparently it's about an em to long so this other guy has created a new method which you can read about here
New MeasureString method
But eventually you should be able to bypass using both of these methods and we can all begin using the much desired DrawTextFormat.CalculateRect
(also anyone please feel free to correct me if I'm passing incorrect information along here, I'm trying my best to be helpful, but I'm new to a lot of this myself) [Edit: I tried to fix whatever funky stuff is going on with the text oddly sizing here (they were VERY small) but I gave up after a bit, but it is larger now at least (and readable)]
Considering DX9 has been out for 2 years now and we are starting to talk about DX10 you are going to find it tough to find people with DX7/8 knowledge....
(I'm assuming means it won't show up in any form in DX10 - maybe someone from DX can confirm this)