Microsoft KB Archive/186087

= Various differences may appear when you view the information in a Word document that is embedded in a Visual FoxPro General field =

Article ID: 186087

Article Last Modified on 2/12/2007

-

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
 * Microsoft Visual FoxPro 7.0 Professional Edition
 * Microsoft Visual FoxPro 8.0 Professional Edition
 * Microsoft Visual FoxPro 9.0 Professional Edition

-



This article was previously published under Q186087



SYMPTOMS
After embedding a Word Document into a Visual FoxPro General field, various discrepancies may occur after activating Word to view the information.


 * If the General field in a Browse window or an OLE bound control that contains the General field is double-clicked, Word opens and shares the menu with Visual FoxPro, which is called In-Place activation. Menu items, under the FILE menu used for Saving or Printing are dimmed.
 * When using @ SAY's or the DoVerb method of a OLE bound control to modify the General field, problems may occur exiting from that instance of Word using the FILE - RETURN menu items. The open document closes, but Word does not close and return to Visual FoxPro.
 * When using @ SAY's or the DoVerb method to access information in the General fields, the Paper Size of an embedded Word document changes from "Letter" to "Custom" although the Word document was saved with a Paper Size setting of "Letter". This occurs with In-Place activation also, but does not occur in every case.



STATUS
This behavior is by design.



MORE INFORMATION
You may access information in a General field with In-Place activation. This is where the application that created the information opens in a window and shares menu items with Visual FoxPro's menu items. Whether this is done by double-clicking the General field in a Browse window or by double-clicking an OLE bound control in a form, there Is no way to save or print the information using the Save or Print menu items under the FILE menu pad. Since the information is already in the General field, as soon as the session of Word ends, the information updates in the General field. If the information is to be printed, an OLE bound control needs to be in the Report Designer so that FoxPro can perform the printing.

A second way to access the information in a General field is to use @ SAY's or the DoVerb method of an OLE bound control. After using one of these methods to call Word and display information, returning to Visual FoxPro from that session of Word using the FILE - CLOSE & RETURN TO UNNAMED menu items, closes the open document. However, Word does not quit and return to FoxPro. This is a problem with Word. Notice the fact that Word does not know who passed it the information by looking at the third menu item under the FILE menu pad. "Close & Return to Unnamed " shows that Word does not know where to return after quitting. When accessing a General field that has information from Excel, Excel knows where to return.

Note Selecting Close & Return to Unnamed works in Microsoft Office Word 2003. Word 2003 closes. Then, focus returns back to Visual FoxPro.

When you use @ SAY's or the DoVerb method, the Paper Size of an embedded Word document changes from "Letter" to "Custom" even though the Word document was saved with a Paper Size setting of "Letter". This also happens when using In-Place activation. The width of the information displayed in Word when using @ SAY's depends on wither there are any windows defined in FoxPro or not. Word takes these "defined window" sizes and displays the information in Word accordingly. If there are no windows defined, then the information displays as close as possible to the desktop width of Visual FoxPro. The width of the OLE bound control determines the width of the information displayed in Word when using OLE bound controls. Making the OLE bound control wider or narrower results in the information in Word becoming wider or narrower.

NOTE: If the information has been saved in the General field as an icon, the Paper size remains at whatever it was set to when it was created.

Steps to Reproduce Behavior
 Create a table that contains a General field. Populate the General field by browsing the table and double-clicking the General field. After the table opens, choose INSERT OBJECT from the EDIT menu. Select Create New and "Microsoft Word Document" from the Object Type list box. Do not select the Icon check box. Type some information into the Word document and close Word by selecting Close from the File menu. To look at the information through In-Place activation, edit the General field by double-clicking the Word object in the General field to open Word. Select the FILE menu and note that menu items for saving or printing are dimmed. From the FILE menu, select PAGE SETUP or double-click the ruler at the top of the document if the ruler available. Note that the paper size is Custom under the Paper Size tab. In Word 2003, Page Setup is not available. When you double-click the ruler, the paper size does not appear.  In the FoxPro Command window, issue the following command: @ 1,1 SAY VERB "Edit"  Follow step 4. From the FILE menu, choose RETURN TO UNNAMED noting that Word closes the document that is currently open. However, Word does not close. You must manually close Word by selecting Exit from the File menu or by clicking the Close button in the upper right hand corner of Word's window. This behavior is different when you use Word 2003. When you select Close & Return to Unnamed, Word 2003 closes and then returns back to Visual FoxPro. Also, you can determine the page size by selecting the Page tab in the Page Setup dialog box. You can do this when you activate the document with an "@...SAY" command.</li></ol>

Additional query words: kbDSupport kbdse

Keywords: kbprb KB186087

-

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

© Microsoft Corporation. All rights reserved.