473,386 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Change the file | Summary | Title

I can read file attributes just fine (author, title, etc,)

But there's no way to update them. I know windows application can do it,
but can a web application update these file attributes?

Here's the code I'm using:

Dim oSummProps As DSOFile.SummaryProperties

Dim oCustProp As DSOFile.CustomProperty

Dim sFile, sTmp As String

Dim m_oDocument As DSOFile.OleDocumentPropertiesClass

m_oDocument = New DSOFile.OleDocumentPropertiesClass

' Note: fileName is just a local file...in this case, c:\test.txt.

m_oDocument.Open(fileName, False, _

DSOFile.dsoFileOpenOptions.dsoOptionOpenReadOnlyIf NoWriteAccess)

If Not m_oDocument.IsReadOnly Then

oSummProps = m_oDocument.SummaryProperties

oSummProps.Title = myNewTitle

m_oDocument.Save()

End If

m_oDocument.Close()

m_oDocument = Nothing

Nov 19 '05 #1
1 1071
Hi Michael:

You should be able to set the properties. Is there an exception or
error message? You might be facing a permissions issue.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 13 Oct 2005 10:22:02 -0700, "Michael Reynolds"
<Mi*************@discussions.microsoft.com> wrote:
I can read file attributes just fine (author, title, etc,)

But there's no way to update them. I know windows application can do it,
but can a web application update these file attributes?

Here's the code I'm using:

Dim oSummProps As DSOFile.SummaryProperties

Dim oCustProp As DSOFile.CustomProperty

Dim sFile, sTmp As String

Dim m_oDocument As DSOFile.OleDocumentPropertiesClass

m_oDocument = New DSOFile.OleDocumentPropertiesClass

' Note: fileName is just a local file...in this case, c:\test.txt.

m_oDocument.Open(fileName, False, _

DSOFile.dsoFileOpenOptions.dsoOptionOpenReadOnlyIf NoWriteAccess)

If Not m_oDocument.IsReadOnly Then

oSummProps = m_oDocument.SummaryProperties

oSummProps.Title = myNewTitle

m_oDocument.Save()

End If

m_oDocument.Close()

m_oDocument = Nothing


Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: K R | last post by:
Hi, I have generated this XML from my application. But, when I open this XML, it is throwing error. Please help me to resolve this. <?xml version="1.0" encoding="utf-8" ?> <searchResults>...
33
by: bissatch | last post by:
Hi, I fully understand the purpose of an alt attribute within a <img> tag but why would you use a title or summary attribute within, for example, a <p> tag. I have read books recommending that I...
3
by: K R | last post by:
Hi, I have generated this XML from my application. But, when I open this XML, it is throwing error. Please help me to resolve this. <?xml version="1.0" encoding="utf-8" ?> <searchResults>...
5
by: Ram [MSFT] | last post by:
Hi All, I'm trying to programatically (using c#) read the file properties (Title, Summary, Author, Comments etc.... The stuff that shows up on the Summary tab when you see the properties of a...
0
by: MS | last post by:
Is the schema used to validate XML Documentation Comments available to be changed by a VS.Net user? I suspect the this question is no so have a couple of requests: 1.) I use #region...
4
by: Eric | last post by:
Hello, I am having some sort of security issue with my code. When I change a file's title in a Windows or console app, I have no problems. (I am using Microsoft's article & DsoFile.dll:...
14
by: Rob Meade | last post by:
Hi all, I'm working on a project where there are just under 1300 course files, these are HTML files - my problem is that I need to do more with the content of these pages - and the thought of...
0
by: Petded | last post by:
Hi im just starting to look at doing some visual c++ winforms stuff using the latest vc++ express edition download im generally familiar with c++. When i generate a winforms i want to name...
0
by: zeng.hui.stephen | last post by:
I download the demo http://msdn.microsoft.com/msdnmag/issues/02/10/cuttingedge/. I inherite the demo, and write my code. I want to use Hook to monitor C++ Edit change. I use a C# form...
3
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
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...
0
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.