1. Solves the crash if you apply the “SaveToServer” methods in Internet explore.
Now you can call the follow scripts to finish the SaveToServer.
Sub SavetoServer()
If OA1.IsOpened = True Then
document.body.style.cursor = “wait”
OA1.HttpInit
Dim strFileName
strFileName = OA1.DocumentName
If strFileName = “” Then
strFileName = “yourguid”
strFileName = strFileName + OA1.GetOpenedFileExt()
End If
OA1.HttpAddPostOpenedFile strFileName
OA1.HttpPost “http://www.ocxt.com/demo/upload_weboffice.php”
document.body.style.cursor = “default”
Dim sPath
On Error Resume Next
sPath = “Save successfully! You can download it at http://www.ocxt.com/demo/” + strFileName
MsgBox sPath
Else
MsgBox “Please open a document firstly!”
End If
End Sub
2. Adds some new methods.
Function: HRESULT GetTempFilePath([out,retval] BSTR* strValue);
Description: Gets a temporary file path.
Function: HRESULT ClearTempFiles();
Description: Clears these temporary files created by the component. The function won’t delete any other files out of OA temporary directory.
Function: HRESULT GetOpenedFileExt([out,retval] BSTR* strValue);
Description: Gets the file extend of the current opened file.
Function: HRESULT GetOpenedFileType([out,retval] OpenedFileType* nType);
Description: Gets the file type of the current opened file.
3. Changes the Insecure Method “void HttpDownloadFile(WebUrl, LocalFile, WebUsername, WebPassword)” to “BSTR HttpDownloadFileToTempDir(WebUrl, WebUsername, VARIANT WebPassword);
Now the component can only download the file to “Internet temporary file directory\OA\”. So anybody can’t use the method to download a file then conver a good system file.
One Response to “What’s New in Version 5.2”
Leave a Reply
You must be logged in to post a comment.
August 27th, 2007 at 6:17 am
NOTE: I worked with Word Automation for years using MANY different versions of Office Primary Interop Assemblies… THIS Ccontrol is the EASIEST control
in the world to control functionallity in ANY word type application.
Without giving a CRAP what version of office the client pc has on it… the SAME JAVASCRIPT code cab be used to:
1. Load a document…. FROM ANYWHERE… local file… no problem…. web server (including SSL)… no problem
2. Save a document…. AGAIN ANYWHERE…
3. Render the ACUTAL APPLICATION WINDOW within a control and have FULL Access to Menus and Toolbars (WHICH IS NOT possible just writing the application/msword mime type to the browser which in turn invoke the office application in your brwoser window… but you have no control over that application instance yet alone the activedocument nor a reliabe way of saying WHAT toolbars you want accessable and just forget about an actual menu)
And the Grand Daddy of them all…. ANY Code i hade in my older automation (working with bookmarks and doing mail merges) can easiy be ported to javascript using the very simple Automation Support (IDispath)…
Note: I work with Dispatch Pointer in C++ and C# All the time, being able to say something like:
var wordDoc = OA1.ActiveDocument;
wordDoc -> Do anything i want here in javascript with the document without any Header files, or interop assemblies or anything…. Just me and my javascript code…. SO SWEET!