Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting a .jpg in Word using VBA from Access

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
I am inserting a Logo a .jpg into a Word doc from Access using the following code
Code:
        .Selection.Font.Bold = wdToggle
        .Selection.Font.Italic = wdToggle
        .Selection.Text = "PREPARED BY"
        .Selection.Font.Size = 10
        .Selection.EndKey Unit:=wdLine
        .Selection.TypeParagraph
        .Selection.TypeParagraph

        .Selection.InlineShapes.AddPicture FileName:= _
            "F:\Marketing\Graphics & Logos\OHC Blue Logo smaller2.jpg", LinkToFile:= _
        False, SaveWithDocument:=True
        .Selection.WholeStory  'Note if I remove this it can't find the inlineshape
        .Selection.InlineShapes(1).Height = 36#
        .Selection.InlineShapes(1).Width = 156.95
I have been creating word macros to get the code it generates and paste it in my Access database to make this work.
When running the macro it won’t let me select the Logo with the mouse so I pressed Ctrl-A (select all). This works and resizes the capture but there it also changes the rest of the text to plain,. I have bold and italics used through out. For some reason it gets rid of the bold and italics.
Can some one help me resize this Logo?

TIA


DougP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top