Microsoft KB Archive/838883

= Drawing page is resized after you embed a Visio drawing in an OLE document container or in an ActiveX document container =

Article ID: 838883

Article Last Modified on 5/21/2007

-

APPLIES TO


 * Microsoft Office Visio Professional 2007
 * Microsoft Office Visio Standard 2007
 * Microsoft Office Visio Professional 2003
 * Microsoft Office Visio Standard 2003
 * Microsoft Visio 2002 Professional Edition
 * Microsoft Visio 2002 Standard Edition
 * Microsoft Visio for Enterprise Architects 2002

-





SYMPTOMS
When you embed a Microsoft Office Visio 2007, Microsoft Office Visio 2003, or Microsoft Visio 2002 drawing in an OLE document container or in an ActiveX document container, and then you click the embedded drawing to activate the drawing, you may find that the drawing page is changed. For example, you may experience these symptoms when you insert a Microsoft Visio drawing into a Microsoft Word document or into an OLE container in Microsoft Visual Basic.



CAUSE
This behavior occurs because the default page size of the drawing is resized when you embed a Visio drawing in an OLE document container or in an ActiveX document container. More specifically, this behavior occurs when you embed a Visio drawing so that the contents of the drawing page fill the container.



WORKAROUND
To work around this behavior, use one of the following methods, depending on your situation:  Modify the Visio drawing that you want to embed so that the original size of the page is retained. In the Visio drawing, add a rectangle that is the same size as the drawing page. By doing so, you avoid the resize operation that occurs after you embed the Visio drawing. The original size of the drawing page is retained. To draw a rectangle that is the same size as the drawing page, follow these steps:  Start Visio, and then open the drawing that you want to embed. On the Drawing toolbar, click Rectangle. Drag the pointer until the rectangle is the same size as the drawing page. Right-click the rectangle, point to Format, and then click Line.

In the Pattern box, click 00:None, and then click OK. Right-click the rectangle, point to Format, and then click Fill.

In the Pattern box, click 00:None, and then click OK.</li> Configure the rectangle so that it is at the back of the z-order.</li> Save your drawing.</li></ol> </li> Use the WebBrowser control to host the Visio drawing. For more information about the WebBrowser control, visit the following Microsoft Web site:

http://msdn2.microsoft.com/en-us/library/Aa752041.aspx

</li> Link the Visio drawing in the OLE document container instead of embedding it.</li></ul>

<div class="moreinformation_section">

MORE INFORMATION
For more information about Visio, visit the following Microsoft Web site:

http://www.microsoft.com/office/visio

Keywords: kbnofix kbbug KB838883

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.