Microsoft KB Archive/274099

= PRB: Page Size of Embedded Word File Changes When Edited =

Article ID: 274099

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 Q274099



SYMPTOMS
If you embed a Microsoft Word file in a general field and then edit it, the document may resize to fit the window.



RESOLUTION
To avoid this problem, use a Linked document instead of an Embedded document. To do so, follow the steps in the &quot;More Information&quot; section, but add the LINK keyword to the APPEND GENERAL statement.



Steps to Reproduce Behavior
  Type the following code into the Command window, and when prompted, choose a Word document: CREATE TABLE wordTable (gWordDoc G) APPEND BLANK APPEND GENERAL gWordDoc FROM GETFILE(&quot;doc&quot;) CLASS &quot;Word.Application&quot; BROWSE  Double-click the &quot;Gen&quot; record. Resize the window to a different width than the displayed document. Close the window, and then reopen it. Double-click the document.

The document appears with new margins, matching the width of the window. If you are working in Visual FoxPro version 3, the size changes to a consistent value, instead of being dependent on the window width.

If you edit the general field in an OLEBoundControl instead, and use the DoVerb(-2) method, it will open in Word. If you then click Page Setup from the File menu, you can determine whether the paper size is different from the original size.

<div class="references_section">