The Word Visual Basic 6 (VB6) compiler lets you insert pictures using your code instead of requiring a user to manually insert a picture. The Word VB6 code uses a picture located on the hard drive and inserts the picture into the document. You use the "AddPicture" function to insert the picture from VB6.
- Skill level:
Other People Are Reading
Click the Windows "Start" button and type "word" in the search text box. Press "Enter" to open the Word software.
Press the "Ctrl" and the "O" keys and double-click your Word document in the dialogue window. Click the "Developer" ribbon tab, then click the "Visual Basic" icon to open the code file.
Copy and paste the following code into the VB editor:
Dim dialogue As Word.Dialog
dialog.ActiveDocument.InlineShapes.AddPicture Filename:="c:\image.jpg", LinkToFile:=False, SaveWithDocument:=True, Range:=Selection.Range
Replace the "c:\image.jpg" with your own image file.
Click the "Save" button. Click "Run" in the VB editor to test the new settings.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for