Hi all,
I am trying to use the DSOleFile.dll in my VB.NET application (that I am
converting from VB6) to extract some property data from a Word document
before the application processes the file. The key feature of the dll is
that it allows the data to be extracted without the document opening in
Word; I successfully used it in VB6 without a problem.
Under .NET, however, after I use a function that calls the dll, the function
appears to keep the file open, so my app can't delete it as it is supposed
to. The code is below:
Private oFilePropReader As DSOleFile.PropertyReader
Private oDocProp As DSOleFile.DocumentProperties
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Public Function getLastEditProperty(ByVal strDoc As String) As String
Dim oFilePropReader As New DSOleFile.PropertyReader
oDocProp = oFilePropReader.GetDocumentProperties(cXFer & strDoc & ".doc")
getLastEditProperty = oDocProp.LastEditedBy
oDocProp = Nothing
oFilePropReader = Nothing
End Function
Anybody have any ideas on how to force a release? Am fairly new to .NET...
is there something I am missing?
TIA and have a great day!
Steve Lang 3 3544
Hi,
System.Runtime.InteropServices.Marshal.ReleaseComO bject(oDocProp)
System.Runtime.InteropServices.Marshal.ReleaseComO bject(oFilePropReader)
Ken
--------------------------
"Steve Lang" <no*****@Nohow.not> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl... Hi all,
I am trying to use the DSOleFile.dll in my VB.NET application (that I am converting from VB6) to extract some property data from a Word document before the application processes the file. The key feature of the dll is that it allows the data to be extracted without the document opening in Word; I successfully used it in VB6 without a problem.
Under .NET, however, after I use a function that calls the dll, the function appears to keep the file open, so my app can't delete it as it is supposed to. The code is below:
Private oFilePropReader As DSOleFile.PropertyReader
Private oDocProp As DSOleFile.DocumentProperties
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Public Function getLastEditProperty(ByVal strDoc As String) As String
Dim oFilePropReader As New DSOleFile.PropertyReader
oDocProp = oFilePropReader.GetDocumentProperties(cXFer & strDoc & ".doc")
getLastEditProperty = oDocProp.LastEditedBy
oDocProp = Nothing
oFilePropReader = Nothing
End Function
Anybody have any ideas on how to force a release? Am fairly new to .NET... is there something I am missing?
TIA and have a great day!
Steve Lang
Thanks Ken - works like a champ!
Steve
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uV**************@tk2msftngp13.phx.gbl... Hi,
System.Runtime.InteropServices.Marshal.ReleaseComO bject(oDocProp)
System.Runtime.InteropServices.Marshal.ReleaseComO bject(oFilePropReader) Ken
--------------------------
"Steve Lang" <no*****@Nohow.not> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... Hi all,
I am trying to use the DSOleFile.dll in my VB.NET application (that I am converting from VB6) to extract some property data from a Word document before the application processes the file. The key feature of the dll is that it allows the data to be extracted without the document opening in Word; I successfully used it in VB6 without a problem.
Under .NET, however, after I use a function that calls the dll, the function appears to keep the file open, so my app can't delete it as it is
supposed to. The code is below:
Private oFilePropReader As DSOleFile.PropertyReader
Private oDocProp As DSOleFile.DocumentProperties
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Public Function getLastEditProperty(ByVal strDoc As String) As String
Dim oFilePropReader As New DSOleFile.PropertyReader
oDocProp = oFilePropReader.GetDocumentProperties(cXFer & strDoc &
".doc") getLastEditProperty = oDocProp.LastEditedBy
oDocProp = Nothing
oFilePropReader = Nothing
End Function
Anybody have any ideas on how to force a release? Am fairly new to
..NET... is there something I am missing?
TIA and have a great day!
Steve Lang
Hi Ken,
Thanks! The code works on my development machine. However, when I try to run
it on the target computer, I am getting errors regarding the DSOLEFile.dll.
Specifically: "The format of the file 'Interop.DSOleFile.dll' is invalid."
I don't understand what the difference is between the development computer
where I wrote the code and it works, and the target machine where it NEEDS
to work! I registered the dll successfully, so I don't think that is the
issue. Any ideas anyone?
TIA,
Steve
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uV**************@tk2msftngp13.phx.gbl... Hi,
System.Runtime.InteropServices.Marshal.ReleaseComO bject(oDocProp)
System.Runtime.InteropServices.Marshal.ReleaseComO bject(oFilePropReader) Ken
--------------------------
"Steve Lang" <no*****@Nohow.not> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... Hi all,
I am trying to use the DSOleFile.dll in my VB.NET application (that I am converting from VB6) to extract some property data from a Word document before the application processes the file. The key feature of the dll is that it allows the data to be extracted without the document opening in Word; I successfully used it in VB6 without a problem.
Under .NET, however, after I use a function that calls the dll, the function appears to keep the file open, so my app can't delete it as it is
supposed to. The code is below:
Private oFilePropReader As DSOleFile.PropertyReader
Private oDocProp As DSOleFile.DocumentProperties
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Public Function getLastEditProperty(ByVal strDoc As String) As String
Dim oFilePropReader As New DSOleFile.PropertyReader
oDocProp = oFilePropReader.GetDocumentProperties(cXFer & strDoc &
".doc") getLastEditProperty = oDocProp.LastEditedBy
oDocProp = Nothing
oFilePropReader = Nothing
End Function
Anybody have any ideas on how to force a release? Am fairly new to
..NET... is there something I am missing?
TIA and have a great day!
Steve Lang
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: |
last post by:
I am using Microsoft's dsofile (http://support.microsoft.com/support/kb/articles/Q224/3/51.asp) in an ASP to update a set of custom properties in a Word document. The document
properties are always...
|
by: Curtis Tammany |
last post by:
Hello-
Can someone tell me if DSOFile.dll can be accessed within ASP.NET?
DSOFile.dll is registered and I have no problem using it in my .ASP scripts. I have tried the following:
Dim...
|
by: Craig |
last post by:
I'm trying to build a filter for a file search where the search will be able
to filter out certain files according to certain "file properties", like
Owner, Creation Date, etc.
MS does this in...
|
by: Jason |
last post by:
I am porting some legacy services to C# and .NET. I have run across two
issues with using DSOLEFILE in .NET, and was hoping somebody might shed
some light...
1. Access Files Across the Network...
|
by: Robert |
last post by:
Somebody converted the DSOlefile ( dsofile.dll ) example to VB.Net ?
It seems that the automatic conversion is NOT complete correct !
I received all (Ms-Office) document properties...
|
by: troutbum |
last post by:
I am experiencing problems when one user has a document open through a
share pointing to the web site. I use the dsolefile to read the
contents of a particular directory and then display them in a...
|
by: Marco |
last post by:
Hello,
I have to use the propertyReader of DSOFile.dll for reading/writing custom
document properties in a closed document.
In the msdn http://support.microsoft.com/?scid=kb;en-us;Q224351...
|
by: Paul Bromley |
last post by:
I have been pondering over this one all night!! I want to read the
properties of a Word document WITHOUT opening it - notably the title
document. Having read the newsgroups it seems that I neede to...
|
by: Henrik |
last post by:
Hi,
I'm trying to set CustomProperties through the newer version of the
DSOleFile (2.x) object for Word, Excel and PowerPoint documents. For some
reason it seems that when I'm trying to set a...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |