Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2006

Tip: Looking for answers? Try searching our database.

Format Picture

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
FGM - 27 Mar 2006 18:46 GMT
Word 2002  Windows 2000

I am using vba to insert a jpg.  However, I would like the layout to be
behinde text and cannot figure out how to add that to my vba coding.  Just by
inserting then the user can not move the jpg in the word document by dragging
it.

Thanks...
Jay Freedman - 27 Mar 2006 20:42 GMT
If you're simply pasting the picture from the clipboard, it's
defaulting to being in line with text. That's why you can't drag it.
Instead, you should insert it from a file as a floating shape to begin
with.

The method works like this:

   Dim oShp As Shape
   
   Set oShp = ActiveDocument.Shapes.AddPicture( _
       FileName:="C:\path\MyPicture.jpg", _
       LinkToFile:=False, _
       SaveWithDocument:=True, _
       Anchor:=Selection.Range)
   With oShp
       ' the next two lines do "behind text"
       .WrapFormat.Type = wdWrapNone
       .ZOrder msoSendBehindText
       
       ' other attributes are optional
       .Left = InchesToPoints(0.25)
       .LockAspectRatio = msoTrue
       .Width = InchesToPoints(1.75)
   End With

--
Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

>Word 2002  Windows 2000
>
[quoted text clipped - 4 lines]
>
>Thanks...
FGM - 27 Mar 2006 20:56 GMT
Thak you that works great...

> If you're simply pasting the picture from the clipboard, it's
> defaulting to being in line with text. That's why you can't drag it.
[quoted text clipped - 36 lines]
> >
> >Thanks...
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.