Insert an Image into Word document in a specified location?? Word/VBA

dragon-goddess1990

New Member
Joined
May 18, 2011
Messages
25
Word 2010

Scenario 1) I would like to be able to get the user to browse for an image (electronic signature) - I dont know how to create a browse control to do this

Scenario 2) I would like to be able to insert a header image into a document in a specific location - I dont know how to reference a specific location / coordinates in the document (bookmark isnt ideal as the header image needs to sit perfect and fill the width etc)

Please help :)

Thanks
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Thanks for the reply but I found a way :)

I split the code. First part is browse button to retrieve file, textbox1.value = strpic.

Secpnd button tells it to put strpic into bookmark
 
Upvote 0
You may have already found a solution but here is a bit of code that will do what you need. The only thing is that you will need to add a path to your image where i have highlighted.

Sub Signature()
Application.ScreenUpdating = False
Dim Rng As Range, Shp As Shape, StrImg As String
StrImg = "C:Add path here"
Set Rng = Selection.Range
Rng.Collapse
Set Shp = ActiveDocument.InlineShapes.AddPicture(FileName:=StrImg, _
SaveWithDocument:=True, Range:=Rng).ConvertToShape
With Shp
.WrapFormat.Type = wdWrapBehind
End With
Set Rng = Nothing: Set Shp = Nothing
Application.ScreenUpdating = True
End Sub

Let me know how it works for you.

Word 2010

Scenario 1) I would like to be able to get the user to browse for an image (electronic signature) - I dont know how to create a browse control to do this

Scenario 2) I would like to be able to insert a header image into a document in a specific location - I dont know how to reference a specific location / coordinates in the document (bookmark isnt ideal as the header image needs to sit perfect and fill the width etc)

Please help :)

Thanks
 
Upvote 0

Forum statistics

Threads
1,225,637
Messages
6,186,137
Members
453,339
Latest member
Stu61

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top