Can anyone help with the code for resizing and moving a picture once it is
inserted in a document?
Show us the macro you've got so far, so that we can build on it?
Also, which version of Word do you have?
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
Sub Macro3()
'
' Macro3 Macro
' Macro recorded 7/20/2006 by Delana Harper
'
With ActiveDocument.Bookmarks(1)
Selection.InlineShapes.AddPicture
FileName:="P:\dharper\GovOfficeTemplates\msoffice\signature\jer.jpg",
LinkToFile:= _
False, SaveWithDocument:=True
End With
End Sub
> Here is what I have that actually works:
>
OK, I'm going to interpret everything very literally: you're inserting a picture
inline with the text - this would mean text won't "flow" around the picture. One
line of text would align with the bottom of the picture, otherwise the text would
be above and below. (Or the picture could be in a line all by itself, with text
above and below). Is this what you want? If yes, if you click the "Right align"
paragraph button, the picture would move to the right.
If this isn't right, can you explain what commands you use on the result of
"Macro3" to make it look right?
I am inserting the picture between 2 lines at a bookmark. The document is a
letter, and the picture I want to insert is a signature. I have figured out
how to get the picture to insert at the bookmark. I have a couple of problems
though. If I insert the picture without referencing the bookmark, then it is
centered on the page. That is the code I already provided. If I insert the
picture at the bookmark, it will insert the bookmark and picture wherever my
cursor is currently placed in the document instead of where I have the
bookmark inserted. I can try the steps you mention below to move the picture
to the right, but I am wondering why the bookmark is moving instead of having
the picture insert at the correct place. Also, I need to change the picture
so that the signature (the content of the picture) is not hiding the rest of
the letter salutation.
Any suggestions on that?
Thanks for any help you can provide.
Delana
> I am inserting the picture between 2 lines at a bookmark. The document is a
> letter, and the picture I want to insert is a signature. I have figured out
> how to get the picture to insert at the bookmark. I have a couple of problems
> though. If I insert the picture without referencing the bookmark, then it is
> centered on the page. That is the code I already provided. If I insert the
> picture at the bookmark, it will insert the bookmark and picture wherever my
> cursor is currently placed in the document instead of where I have the
> bookmark inserted. I can try the steps you mention below to move the picture
> to the right, but I am wondering why the bookmark is moving instead of having
> the picture insert at the correct place. Also, I need to change the picture
> so that the signature (the content of the picture) is not hiding the rest of
> the letter salutation.
>
OK, click in the empty paragraph where you have the bookmark. Right-align it (no
need to use macro code to do something you can pre-set in the document). Now all
that remains is to insert the file at the bookmark. Try this:
Sub InsertSigAtBookmark
Dim doc as Word.Document
Dim bkmName as String
Dim SigFile as String
Set doc = ActiveDocument
bkmName = "BookmarkName"
SigFile = "P:\dharper\GovOfficeTemplates\msoffice\signature\jer.jpg"
doc.InlineShapes.AddPicture :
FileName:=SigFile, _
LinkToFile:=False, _
SaveWithDocument:=True, _
Range:=doc.Bookmarks(bkmName).Range
End Sub