|
|
|
date: Fri, 14 Mar 2008 06:59:00 -0700,
group: microsoft.public.word.vba.addins
back
Re: Shape positioning
Hi Jonathan,
Thanks for taking the time to reply.
The help for Top is :
"The position of a shape is measured from the upper-left corner of the
shape's bounding box to the shape's anchor. The
RelativeVerticalPosition property controls whether the shape's anchor
is positioned alongside the line, the paragraph, the margin, or the
edge of the page."
The help for Left is :
"The position of a shape is measured from the upper-left corner of the
shape's bounding box to the shape's anchor. The
RelativeHorizontalPosition property controls whether the anchor is
positioned alongside a character, column, margin, or the edge of the
page."
I am assuming that when the top value is 0, and the left value is 0
then the anchor should be placed in the top left corner of the shape.
I have documents that demonstrate this not to be the case.
I can upload one of these documents to you if you are interested.
I thank you again for your help.
Ferass
On Mar 14, 12:59 pm, "Jonathan West" wrote:
> Take a look at the Top and Left properties of the Shape object in VBA help> The anchor is the position of the paragraph to which the shape is attached> Every shape is anchored to a paragraph, either in the body of the document> or in a header or footer.
>
> --
> Regards
> Jonathan West - Word MVPwww.intelligentdocuments.co.uk
> Please reply to the newsgroup
>
> "Ferass Elrayes" wrote in message
>
> news:3DC3D2D0-0B62-471A-9BBB-4255EE5475BA@microsoft.com...
>
>
>
> > Hello everyone,
> > I am working on a project that requires me to calculate the exact position
> > of shapes on a page (absolute position from the top left corner of the
> > page).
> > Initially, I tried selecting the shape and using the get_information
> > method
> > to retrieve this information but found that this returns the positon of
> > the
> > anchor.
> > I couldn't establish a relation between that anchor and the top left
> > corner
> > of the image.
> > I have a specific case when the anchor appears on the bottom left corner> > of
> > the image, the vertical positoning is 0 pt from the paragraph and
> > horizontal
> > positioning is 0 pt from a column. In another case the anchor appears in> > the
> > top left corner of the image with the same parameters.
>
> > What are the factors affecting the positioning of the anchor?
>
> > Is there a reliable way to always obtain the absolute positon of the top> > left corner of a shape?
>
> > Your help is much appreciated.- Hide quoted text -
>
> - Show quoted text -
date: Fri, 14 Mar 2008 10:40:21 -0700 (PDT)
author: unknown
Re: Shape positioning
So proceed as follows.
- Read the RelativeVerticalPosition and RelativeHorizontalPosition and store
them somewhere.
- Set both the RelativeVerticalPosition and RelativeHorizontalPosition to be
relative to Page
- Read the Top and Left properties, which will now give you the position of
the shape relative to the top left corner of the page (in points)
- restore the original settings of RelativeVerticalPosition and
RelativeHorizontalPosition
--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
wrote in message
news:3c1c5b37-7cd9-4d29-acc8-9a7d06d90b64@s12g2000prg.googlegroups.com...
Hi Jonathan,
Thanks for taking the time to reply.
The help for Top is :
"The position of a shape is measured from the upper-left corner of the
shape's bounding box to the shape's anchor. The
RelativeVerticalPosition property controls whether the shape's anchor
is positioned alongside the line, the paragraph, the margin, or the
edge of the page."
The help for Left is :
"The position of a shape is measured from the upper-left corner of the
shape's bounding box to the shape's anchor. The
RelativeHorizontalPosition property controls whether the anchor is
positioned alongside a character, column, margin, or the edge of the
page."
I am assuming that when the top value is 0, and the left value is 0
then the anchor should be placed in the top left corner of the shape.
I have documents that demonstrate this not to be the case.
I can upload one of these documents to you if you are interested.
I thank you again for your help.
Ferass
On Mar 14, 12:59 pm, "Jonathan West" wrote:
> Take a look at the Top and Left properties of the Shape object in VBA
> help.
>
> The anchor is the position of the paragraph to which the shape is
> attached.
> Every shape is anchored to a paragraph, either in the body of the document
> or in a header or footer.
>
> --
> Regards
> Jonathan West - Word MVPwww.intelligentdocuments.co.uk
> Please reply to the newsgroup
>
> "Ferass Elrayes" wrote in
> message
>
> news:3DC3D2D0-0B62-471A-9BBB-4255EE5475BA@microsoft.com...
>
>
>
> > Hello everyone,
> > I am working on a project that requires me to calculate the exact
> > position
> > of shapes on a page (absolute position from the top left corner of the
> > page).
> > Initially, I tried selecting the shape and using the get_information
> > method
> > to retrieve this information but found that this returns the positon of
> > the
> > anchor.
> > I couldn't establish a relation between that anchor and the top left
> > corner
> > of the image.
> > I have a specific case when the anchor appears on the bottom left corner
> > of
> > the image, the vertical positoning is 0 pt from the paragraph and
> > horizontal
> > positioning is 0 pt from a column. In another case the anchor appears in
> > the
> > top left corner of the image with the same parameters.
>
> > What are the factors affecting the positioning of the anchor?
>
> > Is there a reliable way to always obtain the absolute positon of the top
> > left corner of a shape?
>
> > Your help is much appreciated.- Hide quoted text -
>
> - Show quoted text -
date: Fri, 14 Mar 2008 22:02:11 -0000
author: Jonathan West
Re: Shape positioning
Thanks again for your help.
This works for many documents. But for the ones to which I was
referring where the anchor is positioned in the lower left corner of
the image, the coordinates are not correct.
Even when I try to change the alignment from Word (not
programatically), the value that appears in the absolute positon field
in the picture position tab of the advanced layout dialogue box is
incorrect and reflects what I am getting programatically.
Any other suggestions?
Thanks kindly,
Ferass
On Mar 14, 6:02 pm, "Jonathan West" wrote:
> So proceed as follows.
>
> - Read the RelativeVerticalPosition and RelativeHorizontalPosition and store
> them somewhere.
> - Set both the RelativeVerticalPosition and RelativeHorizontalPosition to be
> relative to Page
> - Read the Top and Left properties, which will now give you the position of
> the shape relative to the top left corner of the page (in points)
> - restore the original settings of RelativeVerticalPosition and
> RelativeHorizontalPosition
>
> --
> Regards
> Jonathan West - Word MVPwww.intelligentdocuments.co.uk
> Please reply to the newsgroup
>
> wrote in message
>
> news:3c1c5b37-7cd9-4d29-acc8-9a7d06d90b64@s12g2000prg.googlegroups.com...
> Hi Jonathan,
> Thanks for taking the time to reply.
> The help for Top is :
> "The position of a shape is measured from the upper-left corner of the
> shape's bounding box to the shape's anchor. The
> RelativeVerticalPosition property controls whether the shape's anchor
> is positioned alongside the line, the paragraph, the margin, or the
> edge of the page."
> The help for Left is :
> "The position of a shape is measured from the upper-left corner of the
> shape's bounding box to the shape's anchor. The
> RelativeHorizontalPosition property controls whether the anchor is
> positioned alongside a character, column, margin, or the edge of the
> page."
>
> I am assuming that when the top value is 0, and the left value is 0
> then the anchor should be placed in the top left corner of the shape.
> I have documents that demonstrate this not to be the case.
>
> I can upload one of these documents to you if you are interested.
>
> I thank you again for your help.
>
> Ferass
>
> On Mar 14, 12:59 pm, "Jonathan West" wrote:
>
>
>
> > Take a look at the Top and Left properties of the Shape object in VBA
> > help.
>
> > The anchor is the position of the paragraph to which the shape is
> > attached.
> > Every shape is anchored to a paragraph, either in the body of the document
> > or in a header or footer.
>
> > --
> > Regards
> > Jonathan West - Word MVPwww.intelligentdocuments.co.uk
> > Please reply to the newsgroup
>
> > "Ferass Elrayes" wrote in
> > message
>
> >news:3DC3D2D0-0B62-471A-9BBB-4255EE5475BA@microsoft.com...
>
> > > Hello everyone,
> > > I am working on a project that requires me to calculate the exact
> > > position
> > > of shapes on a page (absolute position from the top left corner of the> > > page).
> > > Initially, I tried selecting the shape and using the get_information
> > > method
> > > to retrieve this information but found that this returns the positon of
> > > the
> > > anchor.
> > > I couldn't establish a relation between that anchor and the top left
> > > corner
> > > of the image.
> > > I have a specific case when the anchor appears on the bottom left corner
> > > of
> > > the image, the vertical positoning is 0 pt from the paragraph and
> > > horizontal
> > > positioning is 0 pt from a column. In another case the anchor appears in
> > > the
> > > top left corner of the image with the same parameters.
>
> > > What are the factors affecting the positioning of the anchor?
>
> > > Is there a reliable way to always obtain the absolute positon of the top
> > > left corner of a shape?
>
> > > Your help is much appreciated.- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
date: Sat, 15 Mar 2008 05:28:35 -0700 (PDT)
author: unknown
Re: Shape positioning
Is the anchor within a table cell?
--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
wrote in message
news:a94684ff-247e-450e-886d-ddd73f55ee7f@s13g2000prd.googlegroups.com...
Thanks again for your help.
This works for many documents. But for the ones to which I was
referring where the anchor is positioned in the lower left corner of
the image, the coordinates are not correct.
Even when I try to change the alignment from Word (not
programatically), the value that appears in the absolute positon field
in the picture position tab of the advanced layout dialogue box is
incorrect and reflects what I am getting programatically.
Any other suggestions?
Thanks kindly,
Ferass
On Mar 14, 6:02 pm, "Jonathan West" wrote:
> So proceed as follows.
>
> - Read the RelativeVerticalPosition and RelativeHorizontalPosition and
> store
> them somewhere.
> - Set both the RelativeVerticalPosition and RelativeHorizontalPosition to
> be
> relative to Page
> - Read the Top and Left properties, which will now give you the position
> of
> the shape relative to the top left corner of the page (in points)
> - restore the original settings of RelativeVerticalPosition and
> RelativeHorizontalPosition
>
> --
> Regards
> Jonathan West - Word MVPwww.intelligentdocuments.co.uk
> Please reply to the newsgroup
>
> wrote in message
>
> news:3c1c5b37-7cd9-4d29-acc8-9a7d06d90b64@s12g2000prg.googlegroups.com...
> Hi Jonathan,
> Thanks for taking the time to reply.
> The help for Top is :
> "The position of a shape is measured from the upper-left corner of the
> shape's bounding box to the shape's anchor. The
> RelativeVerticalPosition property controls whether the shape's anchor
> is positioned alongside the line, the paragraph, the margin, or the
> edge of the page."
> The help for Left is :
> "The position of a shape is measured from the upper-left corner of the
> shape's bounding box to the shape's anchor. The
> RelativeHorizontalPosition property controls whether the anchor is
> positioned alongside a character, column, margin, or the edge of the
> page."
>
> I am assuming that when the top value is 0, and the left value is 0
> then the anchor should be placed in the top left corner of the shape.
> I have documents that demonstrate this not to be the case.
>
> I can upload one of these documents to you if you are interested.
>
> I thank you again for your help.
>
> Ferass
>
> On Mar 14, 12:59 pm, "Jonathan West" wrote:
>
>
>
> > Take a look at the Top and Left properties of the Shape object in VBA
> > help.
>
> > The anchor is the position of the paragraph to which the shape is
> > attached.
> > Every shape is anchored to a paragraph, either in the body of the
> > document
> > or in a header or footer.
>
> > --
> > Regards
> > Jonathan West - Word MVPwww.intelligentdocuments.co.uk
> > Please reply to the newsgroup
>
> > "Ferass Elrayes" wrote in
> > message
>
> >news:3DC3D2D0-0B62-471A-9BBB-4255EE5475BA@microsoft.com...
>
> > > Hello everyone,
> > > I am working on a project that requires me to calculate the exact
> > > position
> > > of shapes on a page (absolute position from the top left corner of the
> > > page).
> > > Initially, I tried selecting the shape and using the get_information
> > > method
> > > to retrieve this information but found that this returns the positon
> > > of
> > > the
> > > anchor.
> > > I couldn't establish a relation between that anchor and the top left
> > > corner
> > > of the image.
> > > I have a specific case when the anchor appears on the bottom left
> > > corner
> > > of
> > > the image, the vertical positoning is 0 pt from the paragraph and
> > > horizontal
> > > positioning is 0 pt from a column. In another case the anchor appears
> > > in
> > > the
> > > top left corner of the image with the same parameters.
>
> > > What are the factors affecting the positioning of the anchor?
>
> > > Is there a reliable way to always obtain the absolute positon of the
> > > top
> > > left corner of a shape?
>
> > > Your help is much appreciated.- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
date: Sat, 15 Mar 2008 13:10:38 -0000
author: Jonathan West
Re: Shape positioning
No, the anchor appears within the left margin.
I also have the "Move object with Text", "Allow overlap" and "Layout
in table cell" checked while the "Lock Anchor" is unchecked. The Text
Wrapping is "Top and Bottom".
Does the fact that the text wrapping is top and bottom and the height
of the image is larger than the distance from the anchor to the bottom
of the page affecting anything?
Thanks again Jonathan.
Ferass
On Mar 15, 9:10 am, "Jonathan West" wrote:
> Is the anchor within a table cell?
>
> --
> Regards
> Jonathan West - Word MVPwww.intelligentdocuments.co.uk
> Please reply to the newsgroup
>
> wrote in message
>
> news:a94684ff-247e-450e-886d-ddd73f55ee7f@s13g2000prd.googlegroups.com...
> Thanks again for your help.
> This works for many documents. But for the ones to which I was
> referring where the anchor is positioned in the lower left corner of
> the image, the coordinates are not correct.
> Even when I try to change the alignment from Word (not
> programatically), the value that appears in the absolute positon field
> in the picture position tab of the advanced layout dialogue box is
> incorrect and reflects what I am getting programatically.
>
> Any other suggestions?
>
> Thanks kindly,
>
> Ferass
>
> On Mar 14, 6:02 pm, "Jonathan West" wrote:
>
>
>
> > So proceed as follows.
>
> > - Read the RelativeVerticalPosition and RelativeHorizontalPosition and
> > store
> > them somewhere.
> > - Set both the RelativeVerticalPosition and RelativeHorizontalPosition to
> > be
> > relative to Page
> > - Read the Top and Left properties, which will now give you the position> > of
> > the shape relative to the top left corner of the page (in points)
> > - restore the original settings of RelativeVerticalPosition and
> > RelativeHorizontalPosition
>
> > --
> > Regards
> > Jonathan West - Word MVPwww.intelligentdocuments.co.uk
> > Please reply to the newsgroup
>
> > wrote in message
>
> >news:3c1c5b37-7cd9-4d29-acc8-9a7d06d90b64@s12g2000prg.googlegroups.com...> > Hi Jonathan,
> > Thanks for taking the time to reply.
> > The help for Top is :
> > "The position of a shape is measured from the upper-left corner of the
> > shape's bounding box to the shape's anchor. The
> > RelativeVerticalPosition property controls whether the shape's anchor
> > is positioned alongside the line, the paragraph, the margin, or the
> > edge of the page."
> > The help for Left is :
> > "The position of a shape is measured from the upper-left corner of the
> > shape's bounding box to the shape's anchor. The
> > RelativeHorizontalPosition property controls whether the anchor is
> > positioned alongside a character, column, margin, or the edge of the
> > page."
>
> > I am assuming that when the top value is 0, and the left value is 0
> > then the anchor should be placed in the top left corner of the shape.
> > I have documents that demonstrate this not to be the case.
>
> > I can upload one of these documents to you if you are interested.
>
> > I thank you again for your help.
>
> > Ferass
>
> > On Mar 14, 12:59 pm, "Jonathan West" wrote:
>
> > > Take a look at the Top and Left properties of the Shape object in VBA
> > > help.
>
> > > The anchor is the position of the paragraph to which the shape is
> > > attached.
> > > Every shape is anchored to a paragraph, either in the body of the
> > > document
> > > or in a header or footer.
>
> > > --
> > > Regards
> > > Jonathan West - Word MVPwww.intelligentdocuments.co.uk
> > > Please reply to the newsgroup
>
> > > "Ferass Elrayes" wrote in
> > > message
>
> > >news:3DC3D2D0-0B62-471A-9BBB-4255EE5475BA@microsoft.com...
>
> > > > Hello everyone,
> > > > I am working on a project that requires me to calculate the exact
> > > > position
> > > > of shapes on a page (absolute position from the top left corner of the
> > > > page).
> > > > Initially, I tried selecting the shape and using the get_information> > > > method
> > > > to retrieve this information but found that this returns the positon> > > > of
> > > > the
> > > > anchor.
> > > > I couldn't establish a relation between that anchor and the top left> > > > corner
> > > > of the image.
> > > > I have a specific case when the anchor appears on the bottom left
> > > > corner
> > > > of
> > > > the image, the vertical positoning is 0 pt from the paragraph and
> > > > horizontal
> > > > positioning is 0 pt from a column. In another case the anchor appears
> > > > in
> > > > the
> > > > top left corner of the image with the same parameters.
>
> > > > What are the factors affecting the positioning of the anchor?
>
> > > > Is there a reliable way to always obtain the absolute positon of the> > > > top
> > > > left corner of a shape?
>
> > > > Your help is much appreciated.- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
date: Sat, 15 Mar 2008 06:50:06 -0700 (PDT)
author: unknown
|
|