PRB: SaveToFile Method Does Not Save Embedded Document in Proper Format (313812)
The information in this article applies to:
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
This article was previously published under Q313812 SYMPTOMS There may be situations where you want to access an Excel
spreadsheets or Word documents, but you may not have the access to Excel or
Word environment. This can be achieved by inserting the document in an OLE
container. After editing the document, you may save the document
programmatically using SaveToFile method of OLE container. When you try to open the document again
using Excel or Word application environment, the document will not open in
proper format.CAUSEThe embedded documents are saved in a format other than
Excel Spreadsheet or Word document.WORKAROUNDTo workaround this behavior, use the methods of the
contained server application instead of the method of the OLE container. The Object property provides access to the contained object and its object
model. For example, in order to save a Word Document contained in OLE container
in appropriate format, use SaveAs method of Word Application. OLE1.Object.SaveAS "C:\MyFile.doc" STATUS This
behavior is by design.
| Modification Type: | Minor | Last Reviewed: | 4/24/2003 |
|---|
| Keywords: | kbOLEApp kberrmsg kbprb KB313812 kbAudDeveloper |
|---|
|