Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-05-2013, 06:46 AM
macropod's Avatar
macropod macropod is offline Insert a picture into word using DDE (Dynamic Data Exchange) Windows 7 64bit Insert a picture into word using DDE (Dynamic Data Exchange) Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi sasdde,

I know nothing of SAS, but from from I can see in your code there is no reference to either a textbox or a bookmark.

You say you've been able to insert the picture into the document using a bookmark. Have you tried putting the bookmark inside the textbox? Also, when inserting a picture into a textbox, it has to be inserted in the 'in-line with text' format (ie as an inlineshape).

As I understand it, you can impelement both Wordbasic and VBA in SAS. The VBA equivalent would be:
Code:
ActiveDocument.InlineShapes.AddPicture "C:\Users\picture.jpg", , , ActiveDocument.Shapes(1).TextFrame.TextRange
 
or
 
With ActiveDocument.Shapes(1).TextFrame
  .TextRange.InlineShapes.AddPicture "C:\Users\picture.jpg", , , .TextRange
End With
where the textbox is the first shape object in the document. If you put a bookmark into the shape, though, the code becomes:
Code:
ActiveDocument.InlineShapes.AddPicture "C:\Users\picture.jpg", , , ActiveDocument.Bookmarks("BkMk").Range

or

With ActiveDocument.Bookmarks("BkMk")
  .Range.InlineShapes.AddPicture "C:\Users\picture.jpg", , , .Range
End With
where 'BkMk' is your bookmark name.

As you can see, with the bookmark, there's no need to reference the textbox, or know which of any number of shapes in the document it might be.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert a picture into word using DDE (Dynamic Data Exchange) Insert picture background in Word mail merge labels obasanla Mail Merge 6 11-26-2012 11:53 PM
Insert a picture into word using DDE (Dynamic Data Exchange) VBA: Include Dynamic Sheet Name In Pivot Table Source Data ibrahimaa Excel Programming 2 04-28-2012 12:27 AM
Insert a picture into word using DDE (Dynamic Data Exchange) word insert data into excel elemental Word 1 04-29-2011 06:33 PM
Insert a picture into word using DDE (Dynamic Data Exchange) Macro for Picture Insert rfhall50 Word VBA 2 10-25-2010 12:41 PM
Insert a picture into word using DDE (Dynamic Data Exchange) Can I insert a picture into a picture ? alexcalgary Drawing and Graphics 2 10-16-2010 03:29 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:24 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft