#1
|
|||
|
|||
How to read binary data from currently open file?
*** SOLVED ***
Here's the problem: I have a web-based facility for uploading word documents. This facility parses the xml data of the document and extracts the data that is required. I am now writing a macro that will allow the user to upload the document directly to the server via cURL at the click of a button on the Quick Access toolbar. I have adapted the code from here (http://stackoverflow.com/questions/8...ry-file-to-var) to read in the document's binary data, as follows: Code:
Public Sub Sandbox() filename = ActiveDocument.Path & "\" & ActiveDocument.name Dim f As Integer f = FreeFile() Open filename For Binary Access Read As #f bin2var = Space(FileLen(filename)) Get #f, , bin2var Close #f End Sub It has been suggested that I write a macro which extracts the data required and then uploads it to the server, but from my point of view that is absurd - I already have a perfectly good PHP script to do the job, I don't want to re-invent the wheel. How can I read the raw binary data of the currently open file? *** SOLVED *** No worries - sorted it myself. |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can't open objects in read-only Word 2007 document | Calab | Word | 6 | 04-07-2014 05:02 AM |
HELP: Binary page numbering | mechwurm | Word | 3 | 03-27-2014 10:57 AM |
excel cannot open the file .xlsx because the file format or file extension is not val | teddysika | Excel | 1 | 11-22-2012 06:06 AM |
Word documents suddenly and randomly open read only | Jennifer Murphy | Word | 0 | 09-03-2011 10:13 PM |
Open an outlook 2003 pst data-file from inside outlook 2010 | pinholt | Outlook | 2 | 11-10-2010 07:16 AM |