PRB: Page Size of Embedded Word File Changes When Edited (274099)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 3.0
  • Microsoft Visual FoxPro for Windows 3.0b
  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 6.0

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 "More Information" section, but add the LINK keyword to the APPEND GENERAL statement.

MORE INFORMATION

Steps to Reproduce Behavior

  1. 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("doc") CLASS "Word.Application"
    BROWSE
  2. Double-click the "Gen" record.
  3. Resize the window to a different width than the displayed document.
  4. Close the window, and then reopen it.
  5. 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.

REFERENCES

For additional information about the same problem in Word 6.0, click the article number below to view the article in the Microsoft Knowledge Base:

121049 Wrong Page Size for Word 6.0 Document Object Opened to Edit


Modification Type:MajorLast Reviewed:5/12/2003
Keywords:kbCodeSnippet kbprb KB274099 kbAudDeveloper