A
anand
Hello Group following code ia a word macro, converts all EMF/Pictures of a
word document into Images.
, well thecode is working fine with 2003 , not with 2000, Is it the problem
of library versioning as 2000 uses microsoft object library 9.0 while 2003
uses 11.0. Surprisingly it works when we debug with Key F8.Looking for some
work around . any help would be saluted.
Thanks
Anand
-----------------------------
sub Convert()
Dim MyPix As Shape
Dim PastedPix As Shape
Dim MyRange As Range
Dim PixWrap As Long
Dim PixWrapSide As Long
Dim PixTop As Long
Dim PixLeft As Long
Set MyRange = Selection.Range
For Each MyPix In ActiveDocument.Range.ShapeRange
If MyPix.Type = msoPicture Then
With MyPix
With .WrapFormat
PixWrap = .Type
PixWrapSide = .Side
End With
PixTop = .Top
PixLeft = .Left
.Select
End With
Selection.Cut
Selection.PasteSpecial Link:=False, DataType:=13, Placement:= _
wdFloatOverText, DisplayAsIcon:=False
Set PastedPix = Selection.ShapeRange(1)
With PastedPix
With .WrapFormat
.Type = wdWrapTight
.Side = PixWrapSide
.AllowOverlap = msoFalse
End With
.LockAnchor = msoFalse
.RelativeVerticalPosition = wdRelativeVerticalPositionPage
.Top = InchesToPoints(1.75)
.RelativeHorizontalPosition = wdRelativeHorizontalPositionColumn
.Left = PixLeft
.Top = PixTop
End With
Set PastedPix = Nothing
End If
Next MyPix
MyRange.Select
Set MyRange = Nothing
end sub
word document into Images.
, well thecode is working fine with 2003 , not with 2000, Is it the problem
of library versioning as 2000 uses microsoft object library 9.0 while 2003
uses 11.0. Surprisingly it works when we debug with Key F8.Looking for some
work around . any help would be saluted.
Thanks
Anand
-----------------------------
sub Convert()
Dim MyPix As Shape
Dim PastedPix As Shape
Dim MyRange As Range
Dim PixWrap As Long
Dim PixWrapSide As Long
Dim PixTop As Long
Dim PixLeft As Long
Set MyRange = Selection.Range
For Each MyPix In ActiveDocument.Range.ShapeRange
If MyPix.Type = msoPicture Then
With MyPix
With .WrapFormat
PixWrap = .Type
PixWrapSide = .Side
End With
PixTop = .Top
PixLeft = .Left
.Select
End With
Selection.Cut
Selection.PasteSpecial Link:=False, DataType:=13, Placement:= _
wdFloatOverText, DisplayAsIcon:=False
Set PastedPix = Selection.ShapeRange(1)
With PastedPix
With .WrapFormat
.Type = wdWrapTight
.Side = PixWrapSide
.AllowOverlap = msoFalse
End With
.LockAnchor = msoFalse
.RelativeVerticalPosition = wdRelativeVerticalPositionPage
.Top = InchesToPoints(1.75)
.RelativeHorizontalPosition = wdRelativeHorizontalPositionColumn
.Left = PixLeft
.Top = PixTop
End With
Set PastedPix = Nothing
End If
Next MyPix
MyRange.Select
Set MyRange = Nothing
end sub