The subject line is the whole question: Is there a way of testing in VBA
whether a file was last saved in Word, RTF, WinWord 2.0, WordPerfect 5.x, or
some other format?

Many thanks for any help.

Edward Mendelson

Re: Can VBA tell which format a document was last saved in? by Jezebel

Jezebel
Sun Aug 29 17:04:04 CDT 2004

You'll need to clarify: are you trying to determine the format used for the
last Save operation, or are you looking for a reliable way to determine the
format of a file?

If the latter, open the file for binary and read the first few bytes:

D0 CF 11 E0 A1 B1 1A E1 = Office document
7B 5C 72 74 66 31 = RTF
FF 57 50 43 = Word Perfect


Do a Google for file signatures for many more of these.





"Edward Mendelson" <edward_mendelson@ziffdavisdotcom.no.junk.no> wrote in
message news:udYkS8djEHA.3896@TK2MSFTNGP15.phx.gbl...
> The subject line is the whole question: Is there a way of testing in VBA
> whether a file was last saved in Word, RTF, WinWord 2.0, WordPerfect 5.x,
or
> some other format?
>
> Many thanks for any help.
>
> Edward Mendelson
>
>



Re: Can VBA tell which format a document was last saved in? by Edward

Edward
Sun Aug 29 18:18:58 CDT 2004

Thanks, Jezebel. That turns out to be exactly what I need (and, for the
record, the Word for Windows 2.0 format, which is what I want to test for,
has the signature DB A5 2D).

Thanks again!

Edward Mendelson

"Jezebel" <dwarves@heaven.com.kr> wrote in message
news:epZ3aQhjEHA.3016@tk2msftngp13.phx.gbl...
> You'll need to clarify: are you trying to determine the format used for
the
> last Save operation, or are you looking for a reliable way to determine
the
> format of a file?
>
> If the latter, open the file for binary and read the first few bytes:
>
> D0 CF 11 E0 A1 B1 1A E1 = Office document
> 7B 5C 72 74 66 31 = RTF
> FF 57 50 43 = Word Perfect
>
>
> Do a Google for file signatures for many more of these.
>
>
>
>
>
> "Edward Mendelson" <edward_mendelson@ziffdavisdotcom.no.junk.no> wrote in
> message news:udYkS8djEHA.3896@TK2MSFTNGP15.phx.gbl...
> > The subject line is the whole question: Is there a way of testing in VBA
> > whether a file was last saved in Word, RTF, WinWord 2.0, WordPerfect
5.x,
> or
> > some other format?
> >
> > Many thanks for any help.
> >
> > Edward Mendelson
> >
> >
>
>