![]() |
|
#1
|
|||
|
|||
![]()
Hi all,
I have a macro in word but would like to change 1 line to have a username in it. at the moment the line reads: \\server\users\mstorey\winword\template is there any way of changing the bit that says mstorey to something like username? so when I roll it out to users to picks up their username and then places it in that place? Thanks Martin |
#2
|
|||
|
|||
![]() HTML Code:
Selection.TypeText Text:="\\server\users\" Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _ "USERNAME \* Lower ", PreserveFormatting:=True Selection.TypeText Text:="\winword\templates" |
#3
|
|||
|
|||
![]()
Many thanks for that - it looks good.
Just a quick one - how would I insert that in to this line? Documents.Add Template:="\\neptune\users\%username%\WINWORD\TEMPLATE\TCH LETTER.dot", _ NewTemplate:=False Thanks |
#4
|
|||
|
|||
![]()
Hi all,
any ideas on the above? Thanks |
#5
|
|||
|
|||
![]() Code:
Documents.Add Template:="\\neptune\users\" & Environ("UserName") & "\WINWORD\TEMPLATE\TCH LETTER.dot", _ NewTemplate:=False |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word 2003 macro to Word 2007 to 2010 to... | maruapo | Word VBA | 0 | 06-04-2010 03:43 PM |
Word Macro Tutorial | Jax | Word VBA | 0 | 04-27-2010 09:13 PM |
Word macro | weezypenguin | Word | 0 | 02-25-2010 01:25 PM |
Problem with AutoClose macro and Word 2003 | cholo | Word VBA | 0 | 07-08-2009 05:48 AM |
Word 2000 Macro not working properly | brianlb | Word VBA | 1 | 07-01-2009 07:04 AM |