View Single Post
 
Old 11-01-2017, 06:32 AM
Syasthe Syasthe is offline Windows 10 Office 2016
Novice
 
Join Date: Nov 2017
Posts: 1
Syasthe is on a distinguished road
Default Insert specific picture and add specific Text to it

Hello

I need a macro, which opens a folder, where I have my pictures. Then, depending on which picture I choose, it should insert a certain text. The pictures will be inserted in a table cell and the text should appear in the next table cell.

For better understanding, I need it to insert warning signs in manuals and the description of the warning signs. So the pictures and descriptions are always the same.

To open the Folder, I thought, something like this could work:

Code:
    Dim sPath As String
    Dim sPicPath As String
    Dim lRes As Long
    
    sPicPath = "C:\Temp"
    sPath = Options.DefaultFilePath(path:=wdPicturesPath)
    Options.DefaultFilePath(path:=wdPicturesPath) = sPicPath
    lRes = Application.Dialogs(wdDialogInsertPicture).Show
    Options.DefaultFilePath(path:=wdPicturesPath) = sPath
I found this code and it works, but I don't know how to continue. I'm new to VBA.

Thank you for your time
Reply With Quote