J
jlawson
I'm trying to get an image to appear after a bookmark in Word when
the user puts in their password. The scenario is the supervisor clicks
on a check box in the document; it runs a macro on entry, brings up a
UserForm where the supervisor will fill out information and put in
their password. After their password is in and they click OK macros
will run a IF THEN statement against the password and if it is correct
put their name and image (signature) into the document. I've gotten
everything working except the image part. VBA help suggests using a
macro to insert a drawing canvas and then insert the image into it.
Is there an easier way to insert the image or is the drawing canvas
idea the way to go. I couldn't figure out an easy way to judge where
the canvas will go to. Word uses numbers from left to top to position
the canvas. Let me show you what I have so far...
Dim shpCanvas As Shape
Set shpCanvas = ActiveDocument.Shapes.AddCanvas(Left:=100, Top:=75,
Width:=200, _
Height:=300)
If UserForm4.txtPassword.Text = "dude" Then
ActiveDocument.FormFields("ApBy").Result = "Josh"
End If
If UserForm4.txtPassword.Text = "itguy" Then
ActiveDocument.FormFields("ApBy").Result = "Mike"
shpCanvas.CanvasItems.AddPicture _
FileName:="C:\Program Files\Microsoft Office\" & _
"Office\Bitmaps\Styles\stone.bmp", _
LinkToFile:=False, SaveWithDocument:=True
Else
ActiveDocument.FormFields("ApBy").Result = "Invalid Password"
End If
This is just the image part of the Macro. I'm using Word XP. This
group has been so helpful in the past, thank you so much.
the user puts in their password. The scenario is the supervisor clicks
on a check box in the document; it runs a macro on entry, brings up a
UserForm where the supervisor will fill out information and put in
their password. After their password is in and they click OK macros
will run a IF THEN statement against the password and if it is correct
put their name and image (signature) into the document. I've gotten
everything working except the image part. VBA help suggests using a
macro to insert a drawing canvas and then insert the image into it.
Is there an easier way to insert the image or is the drawing canvas
idea the way to go. I couldn't figure out an easy way to judge where
the canvas will go to. Word uses numbers from left to top to position
the canvas. Let me show you what I have so far...
Dim shpCanvas As Shape
Set shpCanvas = ActiveDocument.Shapes.AddCanvas(Left:=100, Top:=75,
Width:=200, _
Height:=300)
If UserForm4.txtPassword.Text = "dude" Then
ActiveDocument.FormFields("ApBy").Result = "Josh"
End If
If UserForm4.txtPassword.Text = "itguy" Then
ActiveDocument.FormFields("ApBy").Result = "Mike"
shpCanvas.CanvasItems.AddPicture _
FileName:="C:\Program Files\Microsoft Office\" & _
"Office\Bitmaps\Styles\stone.bmp", _
LinkToFile:=False, SaveWithDocument:=True
Else
ActiveDocument.FormFields("ApBy").Result = "Invalid Password"
End If
This is just the image part of the Macro. I'm using Word XP. This
group has been so helpful in the past, thank you so much.