Results 1 to 1 of 1
2005-11-18, 22:14 #1
- Join Date
- Feb 2001
- Silicon Valley, USA
- Thanked 93 Times in 89 Posts
picture.ConvertToShape makes horizontal line (2000
We generate documents with pictures that I want to float to the right margin several paragraph up from their starting position. I created a macro that cuts and pastes each one, then converts it from an inline shape to a (floating) shape, then positions it. I coded it on Word 2002 and all is well on that platform.
However, I shared the template with a colleague who has Word 2000, and all is not well for her. The ConvertToShape method changes each picture to a horizontal line. Now, it just so happens that the immediately previous shape in the document is a horizontal line that separates each of the records in the report. So even though the inlineshape is a picture, Word seems to want to create the immediately preceding type of shape--or is this just a coincidence? Whatever the reason, the ConvertToShape method doens't let you override Word's choice of convertion and specify the type of shape to create.
In attempting to debug this, I put a stop statement before ConvertToShape and discovered that stepping through the conversion using the VBE, it work perfectly. So the short term workaround for my colleague is for the macro to Stop just before that point, and for her to click the "go" button (and repeat for each image). Obviously an awful hack! (PasteSpecial was another option, but the resolution seems to get downgraded during this process, and you don't end up with an object reference for the shape.)
This seems to be an unpatched bug in Word 2000. If anyone can think of an actual solution, I'd love to hear it.