Click to See Complete Forum and Search --> : [RESOLVED] Getting Strange Graphic values from Word doc


JonnyPoet
March 18th, 2009, 05:23 PM
Hi !
I'm reading word doc ant then drawing it myself using C# in my own document Viewer.
( the point is that there are automtically added data to the documnts and the result is shown to the user. ) OK, This works fine but I have some strange margin output from the word doc. Word uses POINTS Heee:eek:

To be concret. I'm using 'cm' as I'm here in Europe and 1 Inch is 2.54 cm
As I could see using a macro internally when I change the size of the margin in the word doc to for example 2.54 cm ( 1 Inch) then the internal VBA code in Word is (Checked what the macro writes down when changing the margins )
With ActiveSheet.PageSetup
.LeftMargin = Application.CentimeterToPoints(2.54)
.RightMargin = Application.CentimeterToPoints(2.54)
....
End With
So I get 72 Points. To get sure to have the correct measurement I'm retransforming it using

_docMarginTop = wordApp.PointsToCentimeters(doc.PageSetup.TopMargin);In the moment I actually have only word 2003 on my macine and only such files.
What I'm wondering is: Have they done this margins measured in 'points' all the time so also in older versions like word 97, word 2000, will the output be in points ?? I'm asking because word 97, word2000 and word 2003 are most of the docs that will be used in my program and it needs to print the correct margin. And will that be the same in word 2007 too ?

JonnyPoet
March 20th, 2009, 06:19 PM
I resolved it myself by simple testing different docs, of different years it works.