A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Page Layout
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

"Computer Name" in header/footer autotext?



 
 
Thread Tools Display Modes
  #1  
Old October 26th, 2004, 06:25 PM
Fred Holmes
external usenet poster
 
Posts: n/a
Default "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  
Old October 26th, 2004, 11:10 PM
Jezebel
external usenet poster
 
Posts: n/a
Default

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  
Old October 27th, 2004, 02:28 PM
Fred Holmes
external usenet poster
 
Posts: n/a
Default

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  
Old October 27th, 2004, 11:19 PM
Jezebel
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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 02: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 07: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


All times are GMT +1. The time now is 02:23 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.