none
Shapes.Top not set correctly for multiple COM call RRS feed

  • Question

  • Its quite a while (years) that I have been having this problem. When setting the shape.top the final result is not correct. If I store the value of shape.top right after assigning it, it seems to be correct in value, but when I look at the result document it is not (looking at the layout properties). It is not an issue with regards to absolute/relative positioning nor units / margin. Because if I wait 1 second after assigning the position, the result will be correct.

    So I guess there is a delay during the COM call - if I try to position the second shape before the first shape has finished positioning, the first shape will go to some other position in between. 

    So what I have to do is Thread.Sleep(1000) after positioning each one. But that adds up huge amount of delay. And also I have no idea how much time I need to wait in another machine.

    Are there any other suggestions here? Greatly appreciate.

    Friday, March 8, 2013 7:06 PM

Answers

  • Hi Puyo,

    Welcome to the MSDN forum.

    You said about the COM call. Would you please share the code or the project ( the better) for us? I'm not quite sure about this situation. 

    I'm looking forward to hearing from you.

    Good day.


    Yoyo Jiang[MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Frank Lam Tuesday, April 23, 2013 7:06 PM
    Wednesday, March 13, 2013 8:08 AM
    Moderator

All replies

  • Hi Puyo,

    Welcome to the MSDN forum.

    You said about the COM call. Would you please share the code or the project ( the better) for us? I'm not quite sure about this situation. 

    I'm looking forward to hearing from you.

    Good day.


    Yoyo Jiang[MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Frank Lam Tuesday, April 23, 2013 7:06 PM
    Wednesday, March 13, 2013 8:08 AM
    Moderator
  • I have been away and trying to create a sample project to duplicate the issue. However after awhile I cannot duplicate it anymore. I guess I will have to reopen the topic when I meet it again. I think it is either when I have many other Word session opened, or the original document has some anchoring problem fixed itself.

    Tuesday, April 23, 2013 7:05 PM