• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 154
  • Last Modified:

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.
1 Solution
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?

dilansAuthor Commented:
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
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?

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

dilansAuthor Commented:
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.

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
        .InsertAfter prop.Name & "= "
        .InsertAfter prop.Value
    End With
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, _
--------End of Paste----------

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

dilansAuthor Commented:
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.

You can't.
When you right click on the icon and select properties, you are running Word, even if it does not show up in visible form. (Otherwise how do you explain that the custom tab only appears for .doc files and not for not Office applications?)
With my snippet, Word is also running in the background. Invisible. Same as right clicking and selecting properties.

To prove my point, try right clicking on a Word document on a computer that does not have Word installed.
I doubt the Custom tab will appear.

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?
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now