![]() If you want the Shape to always be centered on the page, for example, set this to false. That means the position on the page is not set, editing will affect the vertical position. RngEnd.FormattedText = rngStart.FormattedTextīy default, a Shape will insert with MoveWithText activated. Set shp = (fileName:="C:\Test\icons\Addin_Icon16x16.png", _ RngStart.Collapse wdCollapseStart 'start of document Here an example of using the "convert" methods: Sub MoveShapeToOtherRange()ĭim rngEnd As Word.Range, rngStart As Word.Range Another possibility is to use the ConvertToInlineShape method so that you can work with the Range to move the graphic, then ConvertToShape to turn it back into a Shape, but in this case a number of positioning and wrap properties may need to be reset. Note that once a Shape has been inserted there's no direct way to change the anchor position. I strongly recommend passing a Range to the Shapes.AddPicture method in the Anchor argument for this reason. Unless otherwise specified, this will be the first character of the paragraph wherein the current selection is. It's also possible to insert as an InlineShape then use ConvertToShape in order to have a Shape object to which text wrap formatting can be applied.Įvery Shape must be associated with a Range in the document. While only the FileName argument is required, the last argument - Anchor - is very important if you want to control where the image is positioned when it's inserted. SaveWithDocument, Left, Top, Width, Height, Anchor In this case, leave out the parentheses: FileName, LinkToFile, _ If no Shape object is required a Shape can be inserted without assigning to an object. For example in order to specify the text wrap formatting. Often, this is useful when additional properties need to be set after the object has been inserted. The AddPicture method returns a Shape object. SaveWithDocument, Left, Top, Width, Height, Anchor) To insert a graphics file as a Shape: Dim shp as Word.Shape The first are treated the same as characters in the text flow the latter have text wrap foramtting and "live" in a different layer from the text. Release the mouse button when the images are aligned next to each other as you need them to be.Word has two different ways to manage images and other embedded objects: as InlineShapes and as Shapes. As the sides come close to each other, Word will automatically snap the second image into place next to the first. Release the mouse button.Ĭlick and drag the second image next to the first, where you want it to align. Place a check mark next to "Snap Objects to Other Objects," then click "OK."Ĭlick and drag the first image to where you want it on the page. Word will not allow them to align next to each other if they are too big for the page unless you chose either the "Behind Text" or "In Front of Text" option.Ĭlick "Align" in the Arrange group and choose "Grid Settings." Choose "Square," "Tight," "Through" or "Top and Bottom" if you want the image and your text to be separate or choose "Behind Text" or "In Front of Text" if you aren't concerned with your images and text overlapping each other.Ĭlick the second image and repeat the process of changing the way text interacts with the image.Ĭlick and drag down the top-right corner of each image until both images will fit side by side on the page. Click the "Format" tab, then click "Wrap Text" in the Arrange group. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |