Re: How can I insert the default Outlook signature into a document
- From: zkid <zkid@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 28 Jul 2006 14:14:01 -0700
Chris,
The signatures are located in the following folder:
C:\Documents and Settings\[UserName]\Application Data\Microsoft\Signatures
Each signature has three versions from which to choose: .rtf, .txt or
..html (txt wipes out any formatting).
Use the following code to determine the user's login name to maneuver to the
correct folder:
Option Explicit
'Declare for call to mpr.dll.
Declare Function WNetGetUser Lib "mpr.dll" _
Alias "WNetGetUserA" (ByVal lpName As String, _
ByVal lpUserName As String, lpnLength As Long) As Long
Const NoError = 0 'The Function call was successful
Function GetCurUser() As String
'Buffer size for the return string.
Const lpnLength As Long = 255
'Get return buffer space.
Dim status As Integer
'For getting user information.
Dim lpName, lpUserName As String
'Assign the buffer size constant to lpUserName.
lpUserName = Space$(lpnLength + 1)
'Get the log-on name of the person using product.
status = WNetGetUser(lpName, lpUserName, lpnLength)
'See whether error occurred.
If status = NoError Then
'This line removes the null character. Strings in C are null-
'terminated. Strings in Visual Basic are not null-terminated.
'The null character must be removed from the C strings to be used
'cleanly in Visual Basic.
lpUserName = Left$(lpUserName, InStr(lpUserName, Chr(0)) - 1)
End If
'Display the name of the person logged on to the machine.
GetCurUser = lpUserName
End Function
"Chris Mahoney" wrote:
I've found a solution, for WordMail at least. There's a post here from.
last year, the abominably-named "Word VBA Question" that tells me
exactly what to do :)
I have yet to try non-WordMail signatures though.
- Follow-Ups:
- Re: How can I insert the default Outlook signature into a document
- From: Chris Mahoney
- Re: How can I insert the default Outlook signature into a document
- References:
- How can I insert the default Outlook signature into a document?
- From: Chris Mahoney
- Re: How can I insert the default Outlook signature into a document?
- From: Chris Mahoney
- How can I insert the default Outlook signature into a document?
- Prev by Date: Re: Automating Display of FOUO
- Next by Date: Re: Add Picture on the second page, but it appear on the first pag
- Previous by thread: Re: How can I insert the default Outlook signature into a document?
- Next by thread: Re: How can I insert the default Outlook signature into a document
- Index(es):
Relevant Pages
|