none
mso-position-horizontal & mso-position-horizontal-relative RRS feed

  • Question

  • For v:shape style='...' how do mso-position-horizontal & mso-position-horizontal-relative set the left edge of a text box (and same question for the vertical ones). They appear to be very different ways of setting the edge.

    Also if neither is set, it looks like the margin-left:123.45pt is measured from the page margin, but not from the paragraph margin (if the left margin is set to a non zero value) - yet if measured from text shouldn't it go from the paragraph margin?

    thanks - dave

    ps - not an OpenXML topic.

    {bug1025}


    Very funny video - What's your Metaphor?
    Thursday, February 17, 2011 7:25 PM

All replies

  • Hello Dave,

    Thanks for posting. Are you looking for these two MSDN pages about two attributes?

    MSO-Position-Horizontal Attribute
    http://msdn.microsoft.com/en-us/library/bb263861(VS.85).aspx.

    MSO-Position-Horizontal-Relative Attribute
    http://msdn.microsoft.com/en-us/library/bb263859(VS.85).aspx.

    Actually, I am not very good at this issue. If it is not what you are looking for, I am afraid that I am not able to help you. To get more support, I recommend you could post this issue to Answer sites:

    Microsoft Office Forums:
    http://social.answers.microsoft.com/Forums/en-IN/group/Office.

    Thanks for your understanding and have a nice weekend.


    Bessie Zhao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, February 18, 2011 9:49 AM
  • Yes, those links are to these settings. Unfortunately they don't explain what the settings mean.

    answers is not going to have an answer for this because only the Word team knows what these settings mean. How can I get an authoratative answer from Microsoft?

    thanks - dave


    Very funny video - What's your Metaphor?
    Friday, February 18, 2011 11:12 PM
  • Hello again Dave,

    Actually, I am not very familiar with this topic. However, I will consult other engineers on this question. Once there is some useful information, I will follow up again. Have a nice day.


    Bessie Zhao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, February 22, 2011 9:49 AM
  • Hi;

    Have you been able to find an answer yet?

    thanks - dave


    Very funny video - What's your Metaphor?
    Sunday, February 27, 2011 4:15 PM
  • Hi;

    Have you been able to find an answer yet?

    thanks - dave


    Very funny video - What's your Metaphor?
    Sunday, March 6, 2011 8:42 PM
  • Hello again Dave,

    I have contacted the engineer which might be familiar with this topic. However, I have not got some useful information which could be shared with you now. So I will try again for this issue. It might be some time. Please be patient.  ^_^

    Thanks for your understanding, and have a nice day. 


    Bessie Zhao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, March 7, 2011 7:00 AM
  • Hello again Dave,

    I was contacting this senior engineer. As long as I get the reply from him, I will share the information here. Sorry, I am not sure the exact time. 

    By the way, would you mind sharing a simple file with us here? So it could make this issue more clear for research. 

    Have a nice day.


    Bessie Zhao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, March 14, 2011 5:56 AM
  • Any answer yet?

    thanks - dave


    Very funny video - What's your Metaphor?
    Thursday, March 24, 2011 4:42 PM
  • Hello again Dave,

    I was contacting this senior engineer. As long as I get the reply from him, I will share the information here. Sorry, I am not sure the exact time. 

    Any answer yet?

    thanks - dave


    Very funny video - What's your Metaphor?
    Monday, April 4, 2011 3:08 PM
  • Hi Bessie;

    It's been over 5 weeks - any answer from the senior engineer yet?

    thanks - dave


    Very funny video - What's your Metaphor?
    Sunday, April 24, 2011 8:46 PM
  • Hi Dave,

    I think the author that Bessie mentioned did not response yet.  Also unfortunately, Bessie has left our team last week.  

    I will try to involve other senior engineers in this case.   Sorry for the long idle.  I will do the best to help you solve the problem.

    Good day!

    Thanks


    Michael Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Monday, April 25, 2011 3:18 AM
    Moderator
  • Hi David,

     

    Those attributes correlate to Format Text Box, Layout tab, Advanced… button, Picture Position tab in the Word 2003/2007. In Word 2010 you can get there by right-clicking a Text Box and choosing More Layout Options, Position tab.

     

    mso-position-horizontal correlates to the drop downs on the left of the Horizontal section of Picture Position tab.

    mso-position-horizontal-relative correlates to the drop downs on the right.

     

    I'm not sure what you mean by "if neither is set". Could you elaborate? Are you modifying the HTML in Notepad or just not changing  the settings in the UI. I think those attributes have to be set.

     

    Is there a particular version of Word you are using?

     

    -Aaron Rykhus, Online Support Engineer

    Tuesday, April 26, 2011 7:55 PM
  • Hi Aaron;

    I understand what they are, where they are set, and where they appear in the DOCX file. But to go back to the original question:

    For v:shape style='...' how do mso-position-horizontal & mso-position-horizontal-relative set the left edge of a text box (and same question for the vertical ones). They appear to be very different ways of setting the edge. Also if neither is set, it looks like the margin-left:123.45pt is measured from the page margin, but not from the paragraph margin (if the left margin is set to a non zero value) - yet if measured from text shouldn't it go from the paragraph margin?

    I need to know where the values for those settings are measured from. Our program will read a DOCX file and then render it as PDF (doing some other things too) and so we need to be able to determine where to place everything on the page. We have received DOCX files from customers, created in Word, where both of those values are set, only one is set, and neither is set. We also find where Word renders the text box to be very different from where we think it should be based on our guesses about the documentation.

    I think the question we need answered is very simple, for any combination of style settings, where is the textbox placed?

    thanks - dave


    Very funny video - What's your Metaphor?
    Tuesday, April 26, 2011 8:12 PM
  • Hi David,

    I'll use a simple example to see if I can help out with this.  If I insert a textbox at the beginning of a document, the textbox is located at "margin-left:1.75pt;margin-top:0;width:28.1pt;height:19.3pt", so your left edge should be 1.75pts from the shapes anchor. 

    If that isn't what you are looking for, then it would be helpful to give a very specific example in a document because I'm not sure what you mean by "this is not an Open XML topic".  It sounds like you are asking about the Fallback placement attributes of a shape in a docx file, which would be related to Open XML but I might be thinking about something else.  

    Hope that helps, 

    Brandon

    Friday, April 29, 2011 11:08 PM
    Moderator
  • Hi Brandon;

    Please take a look at http://www.windwardreports.com/temp/Bug1025.docx. The first textbox has the setting:

    <v:shape id="_x0000_s1026" type="#_x0000_t202" style="position:absolute;left:0;text-align:left;margin-left:180pt;margin-top:77.3pt;width:360.25pt;height:231.75pt;z-index:251660288;mso-position-horizontal-relative:text;mso-position-vertical-relative:text;mso-width-relative:margin;mso-height-relative:margin" stroked="f" strokeweight="0">
    

    It has a margin-top of 77.3pt (~ 1") but it is rendered about 1/2" from the top of the page. I think the mso-position-vertical-relative:text would place it 1" below the initial text in the document?

    I had the same problem with a mso-position-horizontal and mso-position-horizontal-relative case but cannot find the file now.

    I think the more fundamental problem is it is not documented how all these settings work together. What has priority over what, what further adjusts over what, etc. For example, that shape also has position:absolute which means position from the "parent." Is that the page, margin, column, paragraph, or position in the paragraph where the shape is placed?

    If something could explain the relationship between position, mso-position-*, margin-*, and top/left - that would help a lot.

    thanks - dave


    Very funny video - What's your Metaphor?
    Monday, May 2, 2011 4:04 PM
  • That textbox is anchored to the first paragraph.  My understanding is that Word will start drawing the textbox 77.3pts (vertically) and 180pts (horizontally) from that first paragraph. 

    I think "ISO/IEC 29500-1:2008", found at the link below should give you the specific details about these values.

    http://standards.iso.org/ittf/PubliclyAvailableStandards/index.html

    Brandon

    Monday, May 2, 2011 6:54 PM
    Moderator
  • Hi Brandon;

    Maybe I'm missing something but all I found in that document for mso-position-horizontal was:

    MSO-Position-Horizontal  Specifies the horizontal positioning data for objects in WordprocessingML.

    That doesn't even list its allowed values, much less what those values mean. Am I missing something?

    thanks - dave


    Very funny video - What's your Metaphor?
    Monday, May 2, 2011 7:40 PM
  • Hey Dave,

    The document ISO/IEC 29500-4:2008 should give you more information about the allowed values.

    Brandon

    Monday, May 2, 2011 8:46 PM
    Moderator
  • Hi Brandon;

    I did a search for mso-position-horizontal in that PDF and there were zero occurances. Did I miss something?

    thanks - dave


    Very funny video - What's your Metaphor?
    Monday, May 2, 2011 11:42 PM
  • I think it starts on page 574.

    Brandon


    Tuesday, May 3, 2011 12:07 AM
    Moderator
  • Hi Brandon;

    Weird a text search didn't find that. Unfortunately, this is the same limited documentation - it gives values but does not say how that is specifically used for positioning.

    For example, mso-position-horizontal-relative says it overrides mso-position-horizontal - but what do they mean by override? It can't mean replace because there would be no reason to have both settings then.

    Another example what does the absolute value mean - a measurement has to be from somewhere.

    Is there some documentation that says how these are supposed to be applied, and how they interact with each other?

    thanks - dave


    Very funny video - What's your Metaphor?
    Tuesday, May 3, 2011 3:34 AM
  • Hey David,

    Sorry for the delay in getting back to you.  As far as I know, that is the only documentation that we have.

    You can go to the following link and see if there is anything else available that will help you. 

    http://msdn.microsoft.com/en-us/office/bb265236.aspx

    Brandon

    Thursday, May 12, 2011 2:22 PM
    Moderator
  • Hi Brandon;

    I have a fundamental question around this. As I understand it, and I might be wrong, Microsoft has sold Office to numerous governments and large corporations as being based on OpenXML as a fully defined open standard. And that purchases were made by those entities only because OpenXML is a fully defined open standard.

    Is that true? If so, then I think Microsoft needs to provide additional information where the DOCX spec is incomplete. So my question is, since this is not presently documented, how can we get it documented?

    I'm not trying to be a pain here, but without this information it is impossible for us to correctly render a DOCX file. And Microsoft is the only entity that can clarify this.

    ??? - thanks - dave


    The future of B.I. - Raw & Uncut
    Thursday, May 12, 2011 3:00 PM
  • Hey David,

    I'm afraid I can't answer why a company purchased Office, but if you contact them directly, you might be able to get their reasons and verify if that is true.

    My understanding is that Microsoft created the file format and gave that information to the ISO committee.  They reviewed it and felt it had enough information and in turn created the different file format specification documents.  If you want more information to be included in those specs, you can contact the ISO to give them this feedback, I think the following link is where you can contact them for this information.

    http://www.iso.org/iso/support/contact_iso.htm

    If you think Microsoft didn't provide enough detail, I would suggest sending the product group this feedback and you can do this at the following link, just click on Office Product Feedback.

    http://support.microsoft.com/contactus/?ws=support&ctt=114&ws=support&ws=support%2csupport#tab5

    If you need more help about the position attributes, then I would recommend creating a support case to see if they can look into the issue further to find out why it's not rendering correctly.

    http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    Brandon

    Thursday, May 12, 2011 9:03 PM
    Moderator