Microsoft KB Archive/265104

= PRB: Document Jumps to Top When You Edit With an OleBoundControl =

Article ID: 265104

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q265104



SYMPTOMS
When you use an OleBoundControl to edit a Microsoft Word document that is stored in a General field, the active area may jump to the top of the document. After you scroll down in the document and make changes, the control flashes and the active area jumps to the top of the document. The amount of time varies for this to take place, but it generally happens within 5-55 seconds. Even though the document is at the top, the cursor remains at the position you were editing.



RESOLUTION
Here are two ways you can work around this problem:
 * Set the AutoSize property of the OleBoundBontrol to True.
 * Instead of using the DoVerb method with DoVerb(-1) to allow you to edit the document in Visual FoxPro, use DoVerb(-2). Using DoVerb(-2) opens Microsoft Word in which you can edit the document.



Steps to Reproduce Behavior
 Create a table named doctable and add a General field named worddoc. Store a Word document in the General field. Create a new form in Visual FoxPro 6.0 SP3 and place an OleBoundControl on the form. Set the Control Source of the OleBoundControl to the General field in the doctable table.  Add the following code to the Init event of the form: USE doctable IN 0 SHARED SELECT doctable GO TOP THISFORM.oleboundcontrol1.DoVerb(-1)   Add the following code to the Destroy event of the form: USE IN DOCTABLE </li> Run the form. Scroll down in the document, and make some changes.</li> Wait 5-55 seconds. The document flashes and jumps to the top. The cursor stays where the edit changes were made. If the view size was changed, it changes back to the default value of 100 percent.</li></ol>

<div class="references_section">