Advanced PowerBuilder

HomePrevious Lesson: Saving the Object From the OLE Control
Next Lesson: Linking the OLE Control's Object To a File

Saving the OLE Control as Another File

Calling SaveAs() allows you to save the file to the specified file. You can either save to a file or a storage or sub-storage. This function also comes in different flavors.
String lFileNameWithFullPath, lFileName
Integer lResult
lResult = GetFileSaveName( &
       "Select OLE File to save OLE Control Content", &
       lFileNameWithFullPath, lFileName, "OLE", &
       "OLE Files (*.ole), *.ole" )
If lResult <> 0 Then Return
ole_1.SaveAs( lFileNameWithFullPath )

To see it in the action, run the application. Select 'Module > OLE Control Examples' menu option. Open a file in the OLE Control by clicking on the Open Doc CommandButton and click on the Save As CommandButton.
HomePrevious Lesson: Saving the Object From the OLE Control
Next Lesson: Linking the OLE Control's Object To a File