%userprofile% - Syntax

  • Thread starter Thread starter Arlend Floyd
  • Start date Start date
A

Arlend Floyd

Any one know the correct syntax for "Windows Userprofile" ??? Im using
terminal server and each user needs there own directory for this word
template.

Here is what I have that works without thier own directory.

Documents.Add Template:=("C:\Letters\OfferLetter.Dot")

This is what I need, but its not working.

Documents.Add Template:=("%userprofile%\Application
Data\Letters\OfferLetter.Dot")
 
Hi Arlend

Try the Environ function:

Documents.Add Template:=Environ("userprofile") _
& "\Application Data\Letters\OfferLetter.Dot"

Are you writing this code in Access or Word?
 
Access

Graham Mandeno said:
Hi Arlend

Try the Environ function:

Documents.Add Template:=Environ("userprofile") _
& "\Application Data\Letters\OfferLetter.Dot"

Are you writing this code in Access or Word?
--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Arlend Floyd said:
Any one know the correct syntax for "Windows Userprofile" ??? Im using
terminal server and each user needs there own directory for this word
template.

Here is what I have that works without thier own directory.

Documents.Add Template:=("C:\Letters\OfferLetter.Dot")

This is what I need, but its not working.

Documents.Add Template:=("%userprofile%\Application
Data\Letters\OfferLetter.Dot")
 
Hi Arlend

Access has no native Documents object. You will need to reference it via
the Word.Application object that you have presumably created:

Dim oWord as Object
....
Set oWord = CreateObject( "Word.Application" )
....
oWord.Documents.Add Template:=Environ("userprofile") _
& "\Application Data\Letters\OfferLetter.Dot"
--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Arlend Floyd said:
Access

Graham Mandeno said:
Hi Arlend

Try the Environ function:

Documents.Add Template:=Environ("userprofile") _
& "\Application Data\Letters\OfferLetter.Dot"

Are you writing this code in Access or Word?
--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Arlend Floyd said:
Any one know the correct syntax for "Windows Userprofile" ??? Im using
terminal server and each user needs there own directory for this word
template.

Here is what I have that works without thier own directory.

Documents.Add Template:=("C:\Letters\OfferLetter.Dot")

This is what I need, but its not working.

Documents.Add Template:=("%userprofile%\Application
Data\Letters\OfferLetter.Dot")
 
Thank it works

Graham Mandeno said:
Hi Arlend

Access has no native Documents object. You will need to reference it via
the Word.Application object that you have presumably created:

Dim oWord as Object
...
Set oWord = CreateObject( "Word.Application" )
...
oWord.Documents.Add Template:=Environ("userprofile") _
& "\Application Data\Letters\OfferLetter.Dot"
--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Arlend Floyd said:
Access

Graham Mandeno said:
Hi Arlend

Try the Environ function:

Documents.Add Template:=Environ("userprofile") _
& "\Application Data\Letters\OfferLetter.Dot"

Are you writing this code in Access or Word?
--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Any one know the correct syntax for "Windows Userprofile" ??? Im using
terminal server and each user needs there own directory for this word
template.

Here is what I have that works without thier own directory.

Documents.Add Template:=("C:\Letters\OfferLetter.Dot")

This is what I need, but its not working.

Documents.Add Template:=("%userprofile%\Application
Data\Letters\OfferLetter.Dot")
 
Back
Top