mark007
04-27-2005, 02:18 AM
Using Word 2000.
I'm pasting some charts into word from Excel. Some users are on 2003 - in which case I can just call pasteandformat and the result looks good. For 2000 users though things are much uglier as the method doesn't exist.
So in word 2000 I have:
Selection.PasteSpecial Link:=False, DataType:=wdPasteEnhancedMetafile, _
Placement:=wdInLine, DisplayAsIcon:=False
To paste it in and then:
dim s as ShapeRange
Set s = Selection.ShapeRange
With s
.LockAspectRatio = msoTrue
.Height = 283.45
'.WrapFormat.Type = wdWrapSquare
End With
To format them. The commented out statement is where I have tried all available wordwraps which all seem to do one of 2 things. The text can be typed over it or the text warps round it. The charts do not move with the text though.
What I want is the InLineWithText option something I thought the wdInLine of the paste command might do - but no! I also note that you can't record a macro slecting the inline option.
I've said it before and I'll say it again - I really hate word. MS should completely rip out the object model and start again.... :bug: (though of course leaving the existing one for backwards compataability ;))
Help very much appreciated!
:)
[Edit]
Have now solved by pasting as wdpastemetafilepicture instead of enhanced metafile. Not sure why this works but happy it does!
:)
I'm pasting some charts into word from Excel. Some users are on 2003 - in which case I can just call pasteandformat and the result looks good. For 2000 users though things are much uglier as the method doesn't exist.
So in word 2000 I have:
Selection.PasteSpecial Link:=False, DataType:=wdPasteEnhancedMetafile, _
Placement:=wdInLine, DisplayAsIcon:=False
To paste it in and then:
dim s as ShapeRange
Set s = Selection.ShapeRange
With s
.LockAspectRatio = msoTrue
.Height = 283.45
'.WrapFormat.Type = wdWrapSquare
End With
To format them. The commented out statement is where I have tried all available wordwraps which all seem to do one of 2 things. The text can be typed over it or the text warps round it. The charts do not move with the text though.
What I want is the InLineWithText option something I thought the wdInLine of the paste command might do - but no! I also note that you can't record a macro slecting the inline option.
I've said it before and I'll say it again - I really hate word. MS should completely rip out the object model and start again.... :bug: (though of course leaving the existing one for backwards compataability ;))
Help very much appreciated!
:)
[Edit]
Have now solved by pasting as wdpastemetafilepicture instead of enhanced metafile. Not sure why this works but happy it does!
:)