Re: Can I read the Version into some Buffer without opening the V by Perry
Perry
Sat May 07 06:48:50 CDT 2005
You can't FileCopy() an open file; you'll get the "Access Denied" message.
What you can do to overcome this, is open the source Open() Lock Access
Binary Read.
Look it up in Help files.
Read the content (binary) using Get()
Open a destination file For Binary Access Write and write the byte chunk
using Put()
Note: you'll have to set a buffersize!
Read the Help files.
This technique is utilized for rapid filecopying because of the ability to
buffersize ...
(Note: as stated, this technique will include copying open files)
-------------------------------------
Krgrds.
Perry
System parameters:
POS: WinXP x64
MSO: MSOffice System
DEV: VS7 (dotnet)
-------------------------------------
"Phil" <Phil@discussions.microsoft.com> wrote in message
news:C5E8B7B7-EFDD-4519-BE38-42F2D03286BD@microsoft.com...
> And if that does not work, then replicate what Word does through the
> File-Open dialog when you open a document with the 'Open As Copy' option
> (its
> on the Open button drop-down). Then you can definately open a second copy
> of
> a document.
>
> So in your VBA code, copy the original file to a file with a different
> name
> such as 'Copy of ...', open that file with visible = false, and then open
> the
> version you want.
>
> FileCopy syntax:
> FileCopy SourceFileName, DestinationFileName
>
>
> Good luck! I have to go to bed now :-)
>
>
> "Phil" wrote:
>
>> Ok I see what you mean.
>>
>> I would try starting a second instance of Word, and seeing if you can
>> open
>> the document read-only and invisible, while the document is still open in
>> the
>> other instance. See if it works.
>>
>> As you probably know it gets a bit trickier because you have to make sure
>> the second instance actually does close when you think you are closing
>> it.