PC Review


Reply
Thread Tools Rate Thread

Re: Using the environ function in a world field

 
 
Stefan Blom
Guest
Posts: n/a
 
      31st Jul 2012
The Environ function can be used, from within Visual Basic for Applications, to
return paths represented by environment variables. It can't be embedded in a
field code.

--
Stefan Blom
Microsoft Word MVP




"DanMurphy" wrote in message news(E-Mail Removed)...


Hello All

I am using Word 2007, and trying to make a word template with a users
signature automatically present depending on the user that opens the
document.

I am having little success at the moment however, I am brutishly
inexperienced with Word VBA.

My first attempt was a straightforward inclusion in the word fields

{INCLUDEPICTURE C:\\Signatures\\Environ("Username").bmp}

which returned a broken picture symbol.

My second attempt has been to have a wrapper function around it.

Public Function EMPNAME()

EMPNAME = Environ("Username")

End Function

But including
{INCLUDEPICTURE C:\\Signatures\\{=EMPNAME()}.bmp}

Just returns syntax error.


Could anyone point me in the right direction? It would be greatly
appreciated.




--
DanMurphy

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WORLD TOURSIM WORLD TRAVEL WORLD PACKAGE TAJMAHAL TEMPLE Microsoft Dot NET 0 7th Apr 2008 04:32 PM
Re: Environ function. Tom Ogilvy Microsoft Excel Programming 1 14th Apr 2005 05:04 PM
Environ$ function =?Utf-8?B?Sm9obiBCaWduZXNz?= Microsoft Access Queries 1 2nd Dec 2004 12:17 AM
Environ Function Brent Bowen Microsoft Excel Programming 1 7th Oct 2004 04:58 PM
Undefined Environ function Romeo Germain Microsoft Access Queries 1 20th Aug 2003 10:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:23 PM.