VBA Word - Adicione uma imagem ao Word - Add an Image to Word Document and Scale it using VBA

Dim objWdRange As Word.Range
Dim GraphImage As String
Dim shortString As String

Let shortString = Range("short").Value '? don't know what this is for
Let wrdApp.Visible = True

Set wrdDoc = wrdApp.Documents.Open("C:\Program Files\My Dropbox\dailystrategy.doc")

 Set objWdRange = wrdDoc.Content '? don't know what this is for
    With wrdDoc
        If .Bookmarks.Exists("shortString ") Then
           Let .Bookmarks("shortString ").Range.Text = shortString
        End If

     If .Bookmarks.Exists("GraphImage") Then
         Dim wrdPic As Word.InlineShape
         Set wrdPic = .Bookmarks("GraphImage").Range.InlineShapes.AddPicture(FileName:=GraphImage, LinkToFile:=False, SaveWithDocument:=True)    
         Let wrdPic.ScaleHeight = 50
         Let wrdPic.ScaleWidth = 50
     End If
       .SaveAs "c:\temp\test.doc"
    End With

   Set wrdDoc = Nothing


    Set wrdApp = Nothing

Tags: VBA, Word, document, Scale, image, add,

Related Posts Plugin for WordPress, Blogger...


diHITT - Notícias