Y Coordinate off in 2010 vs 2000? RRS feed

  • Question

  • I'm using VB 2010 to create some word docs and have been doing so for many years.  We have just started using Word 2010 and I'm finding that the Y coordinates seem to be off by around 10 or 11 though the X are still the same.

    If I use the following coordinates (which I have since about 1998) 20 249 570 249 they end up being too low on the page and I have to change it to 20 238 570 238.  I haven't gotten overy deep into testing with Word yet but this is pretty disturbing if it's the case that they have changed how Y coordinates calculated.

    this is the code that I'm using and it really hasn't changed all that much since upgrading to VS 2010.

    line = currentLine.Split(New Char() {" "c})
    ' populate the variables for the line positions
    intBegX = line(0)
    intBegY = line(1)
    intEndX = line(2)
    intEndY = line(3)
    wrdDoc.Shapes.AddLine(intBegX, intBegY, intEndX, intEndY).Select()

    Wednesday, June 13, 2012 10:45 AM


All replies

  • realized i didn't change the Office/Word objects in the project, so I changed them to the latest version... still no change.
    Wednesday, June 13, 2012 4:46 PM
  • I stepped though the code and stopped it after the lines are drawn which is one of the first things in the document and the lines are fine, however it seems after that they are getting pushed down one line at some point.

    Step one is margins and then step two is the lines, then it processes the text for the document.

    Wednesday, June 13, 2012 6:15 PM
  • fixed it... line got deleted that changed the selection
    • Marked as answer by temlehdrol Wednesday, June 13, 2012 7:08 PM
    Wednesday, June 13, 2012 7:08 PM
  • Hi Temlehdrol,

    I’m glad to see that you have solved your issue. Thanks for sharing your experience here. It’s very beneficial for other community members who have similar problem to see how you solved your question.

    Best regards,

    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, June 14, 2012 6:36 AM
  • Unlike some, I actually still work on and try to figure out my problem while I'm waiting to see if someone has help/a better idea.
    Thursday, June 14, 2012 10:26 AM