Link to home
Start Free TrialLog in
Avatar of dilans
dilans

asked on

edit custom variable of any file from the properties option

I want to be able to edit a custom variable associated with any computer file.  For instance if you were in Explorer and you right click and went to properties, there is a custom tab with a particular variable.  I want to be able to edit this variable from within my interface written in VB6.
Avatar of Dabas
Dabas
Flag of Australia image

Your question is not clear, sorry.

Are you saying that you want to create a custom tab that appears when you go to properties, or are you talking of a tab that is already there, and you want to edit a variable there?

To help us help you, lets talk about a certain file that is on everybody's system, lets say the My Documents folder. If I choose properties after right clicking on My Documents, what is it you want to happen?

Dabas
Avatar of dilans
dilans

ASKER

After you right click on "a document" like a word document, a dialog window pops up.  That dialog window contains multiple tabs.  One of those tabs is called "custom".  Within that "custom" tab is a variable.  Let's say it's called "Description"  I want to be able to edit the contents of that variable without having to open the file and going through the "file" pull down menu and then properties within the executing program.

Thank you
Dilan
OK. That helps, because the custom tab appears in Word documents, but not in other types of files.
So shall we restrict ourselves to Word documents?

Dabas
Avatar of dilans

ASKER

Sure, but remember I don't want to have to open the file within Word.  I want to take care of the variable   from within my interface.  Or I guess you'd consider it behind the scenes.

Dilan
I assume it can be done if you go to references and Select Microsoft Word

Reference your document through a Word.Application and a Word.Document object

This is a paste from Word Help

-------------Start Paste-----------
CustomDocumentProperties Property Example

This example inserts a list of custom built-in properties at the end of the active document.

Set myRange = ActiveDocument.Content
myRange.Collapse Direction:=wdCollapseEnd
For Each prop In ActiveDocument.CustomDocumentProperties
    With myRange
        .InsertParagraphAfter
        .InsertAfter prop.Name & "= "
        .InsertAfter prop.Value
    End With
Next
This example adds a custom built-in property to Sales.doc.

thename = InputBox("Please type your name", "Name")
Documents("Sales.doc").CustomDocumentProperties.Add _
    Name:="YourName", LinkToContent:=False, Value:=thename, _
    Type:=msoPropertyTypeString
--------End of Paste----------

Hope that points you in the right direction, otherwise ask again

Dabas
Avatar of dilans

ASKER

That's fine, but what you're showing me requires that Word be running in order to modify/"add" the custom property.  I want to modify the variable from windows not the application.

Dilan
ASKER CERTIFIED SOLUTION
Avatar of Dabas
Dabas
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
dilans:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
Avatar of DanRollins
Moderator, my recommended disposition is:

    Accept Dabas's comment(s) as an answer.
    *** strictly speaking, it may actually be possible using complicated access to IStorage interface, but "You must use Word" is pretty good advice!

DanRollins -- EE database cleanup volunteer