?
Solved

edit custom variable of any file from the properties option

Posted on 2003-03-11
10
Medium Priority
?
148 Views
Last Modified: 2012-05-04
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.
0
Comment
Question by:dilans
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 27

Expert Comment

by:Dabas
ID: 8116248
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
0
 

Author Comment

by:dilans
ID: 8116594
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
0
 
LVL 27

Expert Comment

by:Dabas
ID: 8116693
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
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:dilans
ID: 8116844
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
0
 
LVL 27

Expert Comment

by:Dabas
ID: 8116875
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
0
 

Author Comment

by:dilans
ID: 8117385
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
0
 
LVL 27

Accepted Solution

by:
Dabas earned 700 total points
ID: 8118528
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.

Dabas
0
 

Expert Comment

by:CleanupPing
ID: 8900265
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?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 9097137
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
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month11 days, 13 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question