View Single Post
 
Old 11-13-2017, 12:11 PM
Fritesmodern Fritesmodern is offline Windows 7 32bit Office 2016
Novice
 
Join Date: Nov 2017
Posts: 1
Fritesmodern is on a distinguished road
Default Inserting pictures in a word document launched from another application

I am trying to create a word document from MS Access which inserts a picture into it. The below code triggers an error at the the last statement. Can anybody tell me what is going on?



Thanks





Dim wdApp As Word.Application
Dim As Word.Document

Dim shp As Shape



Set wdApp = CreateObject("Word.APPLICATION")
wdApp.Visible = True
Set wdDoc = wdApp.Documents.Add


Set shp = wdDoc.ActiveWindow.Selection.InlineShapes.AddPictu re(FileName:="C:\MyPicture.jpg", LinkToFile:=False, SaveWithDocument:=True).ConvertToShape
Reply With Quote