If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
"Computer Name" in header/footer autotext?
Word 2003. WinXP
In the View: Header and Footer toolbar, there is an "Insert Autotext" button with a list of handy information, including "Filename and Path." I'd like to expand this to add information as to the computer that the document file exists on, e.g., the computer's network name or any other readily available configuration variable. Or alternatively the username of the currently logged on user. If the working document were kept in "My Documents" (or even on the desktop) the username in the path to "My Documents" would satisfy this requirement, but in the company I'm working for, "C:\data\" substitutes for "My Documents" and is set to be regularly backed up by a network backup process, while "My Documents" is not. Since everyone has a "C:\data\" directory, it isn't distinctive as to user. Perhaps there is some way to parse the username out of the path to "My Documents" or some such? Thanks, Fred Holmes |
#2
|
|||
|
|||
The UserName is contained in the Author field (should be, anyway) -- so you
can use { DocProperty Author } to insert it in a document. Computer name is a little trickier -- it's not built in but it is available through the Environ() collection. You'll need to create your own Document Property for the purpose. Using VBA it would be something like -- ActiveDocument.CustomDocumentProperties.Add Name:="Computer", _ LinkToContent:=False, _ Type:=msoPropertyTypeString, _ Value:=Environ("ComputerName") Then in the document, use { DocProperty Computer } to display the value. "Fred Holmes" wrote in message ... Word 2003. WinXP In the View: Header and Footer toolbar, there is an "Insert Autotext" button with a list of handy information, including "Filename and Path." I'd like to expand this to add information as to the computer that the document file exists on, e.g., the computer's network name or any other readily available configuration variable. Or alternatively the username of the currently logged on user. If the working document were kept in "My Documents" (or even on the desktop) the username in the path to "My Documents" would satisfy this requirement, but in the company I'm working for, "C:\data\" substitutes for "My Documents" and is set to be regularly backed up by a network backup process, while "My Documents" is not. Since everyone has a "C:\data\" directory, it isn't distinctive as to user. Perhaps there is some way to parse the username out of the path to "My Documents" or some such? Thanks, Fred Holmes |
#3
|
|||
|
|||
Many thanks. The ComputerName suggestion should work. I'll work on
it. However, the value of the "Author" field in document properties won't be useful, as it remains the same (the original author) upon successive modification by other people as the document is passed around. I need a reference to the computer where the document was printed from (and where, presumably, the latest modification was made). On Wed, 27 Oct 2004 08:10:06 +1000, "Jezebel" wrote: The UserName is contained in the Author field (should be, anyway) -- so you can use { DocProperty Author } to insert it in a document. Computer name is a little trickier -- it's not built in but it is available through the Environ() collection. You'll need to create your own Document Property for the purpose. Using VBA it would be something like -- ActiveDocument.CustomDocumentProperties.Add Name:="Computer", _ LinkToContent:=False, _ Type:=msoPropertyTypeString, _ Value:=Environ("ComputerName") Then in the document, use { DocProperty Computer } to display the value. "Fred Holmes" wrote in message .. . Word 2003. WinXP In the View: Header and Footer toolbar, there is an "Insert Autotext" button with a list of handy information, including "Filename and Path." I'd like to expand this to add information as to the computer that the document file exists on, e.g., the computer's network name or any other readily available configuration variable. Or alternatively the username of the currently logged on user. If the working document were kept in "My Documents" (or even on the desktop) the username in the path to "My Documents" would satisfy this requirement, but in the company I'm working for, "C:\data\" substitutes for "My Documents" and is set to be regularly backed up by a network backup process, while "My Documents" is not. Since everyone has a "C:\data\" directory, it isn't distinctive as to user. Perhaps there is some way to parse the username out of the path to "My Documents" or some such? Thanks, Fred Holmes |
#4
|
|||
|
|||
UserName should be available -- Word uses it to identify the author of
comments when a document is circulated. "Fred Holmes" wrote in message ... Many thanks. The ComputerName suggestion should work. I'll work on it. However, the value of the "Author" field in document properties won't be useful, as it remains the same (the original author) upon successive modification by other people as the document is passed around. I need a reference to the computer where the document was printed from (and where, presumably, the latest modification was made). On Wed, 27 Oct 2004 08:10:06 +1000, "Jezebel" wrote: The UserName is contained in the Author field (should be, anyway) -- so you can use { DocProperty Author } to insert it in a document. Computer name is a little trickier -- it's not built in but it is available through the Environ() collection. You'll need to create your own Document Property for the purpose. Using VBA it would be something like -- ActiveDocument.CustomDocumentProperties.Add Name:="Computer", _ LinkToContent:=False, _ Type:=msoPropertyTypeString, _ Value:=Environ("ComputerName") Then in the document, use { DocProperty Computer } to display the value. "Fred Holmes" wrote in message .. . Word 2003. WinXP In the View: Header and Footer toolbar, there is an "Insert Autotext" button with a list of handy information, including "Filename and Path." I'd like to expand this to add information as to the computer that the document file exists on, e.g., the computer's network name or any other readily available configuration variable. Or alternatively the username of the currently logged on user. If the working document were kept in "My Documents" (or even on the desktop) the username in the path to "My Documents" would satisfy this requirement, but in the company I'm working for, "C:\data\" substitutes for "My Documents" and is set to be regularly backed up by a network backup process, while "My Documents" is not. Since everyone has a "C:\data\" directory, it isn't distinctive as to user. Perhaps there is some way to parse the username out of the path to "My Documents" or some such? Thanks, Fred Holmes |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using Hyperlinks in Mail Merge IF...THEN...ELSE Statements | Mark V | Mailmerge | 8 | November 30th, 2004 01:31 PM |
word/office templates in the Intranet/Internet left - IE opens createsa new .doc on computer a but opens the .dot on computer b | [email protected] | General Discussion | 1 | November 18th, 2004 06:17 PM |
Autotext watermarks in multi-section documents | Chris J | Formatting Long Documents | 4 | October 28th, 2004 07:39 PM |
copy header/footer btwn sheets | DebbieG | General Discussion | 0 | June 16th, 2004 06:01 AM |
.pst file- loading on new computer | Mike D. | General Discussion | 6 | June 2nd, 2004 06:14 PM |