Open XML - wp:anchor question

D

David Thielen

Word will write the following:

<wp:anchor distT="0" distB="0" distL="114300" distR="114300" simplePos="0"
relativeHeight="251658240" behindDoc="1" locked="0" layoutInCell="1"
allowOverlap="1">
<wp:simplePos x="0" y="0"/>
<wp:positionH relativeFrom="column">
<wp:posOffset>19050</wp:posOffset>
</wp:positionH>
<wp:positionV relativeFrom="paragraph">
<wp:posOffset>43815</wp:posOffset>
</wp:positionV>

However, the way I read the spec I should set simplePos - or -
positionH/positionV. What does it mean to set both?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
J

Jialiang Ge [MSFT]

Hello Dave,

<wp:anchor distT="0" distB="0" distL="114300" distR="114300" simplePos="0"
relativeHeight="251658240" behindDoc="1" locked="0" layoutInCell="1"
allowOverlap="1">
<wp:simplePos x="0" y="0"/>
<wp:positionH relativeFrom="column">
<wp:posOffset>19050</wp:posOffset>
</wp:positionH>
<wp:positionV relativeFrom="paragraph">
<wp:posOffset>43815</wp:posOffset>
</wp:positionV>

1. Set simplePos:
According to the spec Part 4, P3907, the simplePos attribute in the
<wp:anchor> tag specifies that this object shall be positioned using the
positioning information in the simplePos child element (e.g. <wp:simplePos
x="0" y="0"/> in the above example.

If this element is omitted, namely simplePos="0" or simplePos="false", then
this object shall not use the simple positioning information: <wp:simplePos
x="0" y="0"/>.
If this element is true, namely, simplePos="1" or simplePos="true", then
Word will use the setting in <wp:simplePos x="**", y="**"/> to set the
position of the object.

2. Set positionH and positionV:
The tag positionH and positionV will take effect when simplePos = "0" or
simplePos="false". They correspond to the Word 2007 setting:
Picture tools->'Format' tab->Position->More Layout->'Picture Position'
tab->Horizontal/Vertical->'Absolute position' value.

3. Set both:
If simplePos = "1" or "true", <wp:simplePos> will take effect and
<wp:positionH> and <wp:positionV> will be omitted.
If simplePos = "0" or "false", <wp:simplePos> will be omitted, and
<wp:positionH> and <wp:positionV> will take effect.

Please let me know if you have any other concerns, or need anything else.

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document: http://blogs.msdn.com/msdnts/pages/postingAlias.aspx

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
see your reply promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jialiang Ge [MSFT]

Hello Dave,

According to the spec Part 4, Page 3908, the XML Schema fragment defined
for the <anchor> tag:

<complexType name="CT_Anchor"> <sequence> <element name="simplePos"
type="a:CT_Point2D"/> <element name="positionH" type="CT_PosH"/> <element
name="positionV" type="CT_PosV"/> <element name="extent"
type="a:CT_PositiveSize2D"/> <element name="effectExtent"
type="CT_EffectExtent" minOccurs="0"/> <group ref="EG_WrapType"/> <element
name="docPr" type="a:CT_NonVisualDrawingProps" minOccurs="1"
maxOccurs="1"/> <element name="cNvGraphicFramePr"
type="a:CT_NonVisualGraphicFrameProperties" minOccurs="0" maxOccurs="1"/>
<element ref="a:graphic" minOccurs="1" maxOccurs="1"/> </sequence>
<attribute name="distT" type="ST_WrapDistance" use="optional"/> <attribute
name="distB" type="ST_WrapDistance" use="optional"/> <attribute
name="distL" type="ST_WrapDistance" use="optional"/> <attribute
name="distR" type="ST_WrapDistance" use="optional"/> <attribute
name="simplePos" type="xsd:boolean"/> <attribute name="relativeHeight"
type="xsd:unsignedInt" use="required"/> <attribute name="behindDoc"
type="xsd:boolean" use="required"/> <attribute name="locked"
type="xsd:boolean" use="required"/> <attribute name="layoutInCell"
type="xsd:boolean" use="required"/> <attribute name="hidden"
type="xsd:boolean" use="optional"/> <attribute name="allowOverlap"
type="xsd:boolean" use="required"/> </complexType>

The element simplePos is defined in a <sequence>, therefore, the element
MUST exist according to the order set, even if it will be omitted by the
parser.

If you have any other concerns or need anything else, please feel free to
let me know.

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jialiang Ge [MSFT]

Hello Dave,

If you have any other concerns or questions, please feel free to let me
know.

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Top