Page relative locations of shapes.

Discussion in 'Word' started by G0PJO, Nov 7, 2018.

  1. G0PJO

    G0PJO

    Joined:
    Nov 7, 2018
    Messages:
    1
    Likes Received:
    0
    Hi,

    I'm trying to work out the page relative locations of shapes on a page. I'm finding that if I do something like:

    shape.select();
    top = Globals.ThisAddIn.Application.Selection.Information[WdInformation.wdVerticalPositionRelativeToPage];
    left = Globals.ThisAddIn.Application.Selection.Information[WdInformation.wdHorizontalPositionRelativeToPage];

    then I'm getting the location of the associated anchor and not the shape itself.

    Is this to be expected?

    Many thanks

    Martin
     
    G0PJO, Nov 7, 2018
    #1
    1. Advertisements

  2. G0PJO

    macropod Microsoft MVP

    Joined:
    Mar 2, 2012
    Messages:
    398
    Likes Received:
    35
    Your code should be returning the top & left coordinates of the shape, not its anchor. Of course, it's entirely possible they have the same coordinates.
     
    macropod, Nov 7, 2018
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.