Locating Anchor of a Shape 
Author Message
 Locating Anchor of a Shape

I am adding pictures to a document with the following code:

ActiveDocument.Shapes.AddPicture  "C:\Program Files\Microsoft
office\Office\Bitmaps\Styles\stone.bmp",  True, True

There is also an anchor parameter but I am not quite sure how to use it.
How do I specify a particular paragraph that this Shape is anchored to?  Or
if I am iterating through the Paragraphs collection of a document, how do I
identify if a particular paragraph has a shape anchored to it?  Thanks in
advance.  -Ned



Fri, 08 Nov 2002 03:00:00 GMT  
 Locating Anchor of a Shape
Hi Ned,

As a follow-on to Ibby's post, you can get a count of the shaperange (which
is actually a shapes collection) for any paragraph range, as in:

MsgBox ActiveDocument.Paragraphs(3).Range.ShapeRange.Count

--
Bill Coan
Templates, wizards, add-ins, and macros for Word
For more information, visit: www.wordsite.com

Quote:




Quote:
> I am adding pictures to a document with the following code:

> ActiveDocument.Shapes.AddPicture  "C:\Program Files\Microsoft
> office\Office\Bitmaps\Styles\stone.bmp",  True, True

> There is also an anchor parameter but I am not quite sure how to use it.
> How do I specify a particular paragraph that this Shape is anchored to?
Or
> if I am iterating through the Paragraphs collection of a document, how do
I
> identify if a particular paragraph has a shape anchored to it?  Thanks in
> advance.  -Ned



Fri, 08 Nov 2002 03:00:00 GMT  
 Locating Anchor of a Shape
Hi Ned,

Quote:
> There is also an anchor parameter but I am not quite sure how to use it.
> How do I specify a particular paragraph that this Shape is anchored to ?

ActiveDocument.Shapes.AddPicture _
    FileName:="D:\Microsoft Office\Office\Bitmaps\Styles\stone.bmp", _
    LinkToFile:=True, _
    SaveWithdocument:=True, _
    Anchor:=ActiveDocument.Paragraphs(3).Range

--
Hope this helps.
Regards
ibby

Please post replies or follow-ups to the **newsgroup** so that participants
may benefit or contribute.



Sat, 09 Nov 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Convert Inline to Shape and Anchor Shape

2. To distinguish between floating shapes anchored at same paragraph by bookmarks

3. Anchor for shapes

4. Changing the anchor point of a shape in code

5. Shapes shapes shapes

6. new shape in another shape

7. Adding a shape from Forms Shapes Stencil

8. How to differentiate a shape created from Stencil drag/drop and shape Copy/Paste

9. How to update document master shapes from template master shapes

10. Dynamically convert shapes to Process Engineering shapes

11. Dropping shapes through VBA with shape Custom Properties setting ASK =True

12. grouping shapes and convert to inline shape

 

 
Powered by phpBB® Forum Software