A Microsoft Outlook email forum. Outlook Banter

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 » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Set Default Signature in Outlook 2007



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 9th 08, 09:02 PM posted to microsoft.public.outlook.program_addins
jk
external usenet poster
 
Posts: 43
Default Set Default Signature in Outlook 2007

Hi
I try to set default signature through code (C# & VS 2008), it successfully
writes 'New Signature' and 'Reply/Forward Signature' values in a registry.
When I open New mail or reply to any email, my signature does not appear.
I have to restart outlook everytime after setting Default Signature.
Is there any way that I can see my signature in New Email without restarting
the outlook?
Please help me out!!
JK

Ads
  #2  
Old May 9th 08, 09:50 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Set Default Signature in Outlook 2007

I believe that should be "Reply-Forward Signature", not "Reply/Forward
Signature".

You wrote those values in Unicode to the REG_BINARY values to the correct
places in the profile registry keys?

Do the signatures work the next time Outlook is started and after that or
are you saying that the values are being changed after you set them?

Outlook only reads those values as far as I know when it starts up.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"JK" wrote in message
...
Hi
I try to set default signature through code (C# & VS 2008), it
successfully
writes 'New Signature' and 'Reply/Forward Signature' values in a registry.
When I open New mail or reply to any email, my signature does not appear.
I have to restart outlook everytime after setting Default Signature.
Is there any way that I can see my signature in New Email without
restarting
the outlook?
Please help me out!!
JK


  #3  
Old May 9th 08, 10:05 PM posted to microsoft.public.outlook.program_addins
jk
external usenet poster
 
Posts: 43
Default Set Default Signature in Outlook 2007

Thanks for your reply Ken.
You are right, it should be 'Reply-Forward Signature'. I just misspelled it
in the post.
When I set values for the registry in my code, it changes in the registry..
but the problem is that Outlook reads the values from the registry only on
startup.
I restarted the Outlook thru code..it worked fine but its annoying for the
user.
I dont want to restart Outlook.

"Ken Slovak - [MVP - Outlook]" wrote:

I believe that should be "Reply-Forward Signature", not "Reply/Forward
Signature".

You wrote those values in Unicode to the REG_BINARY values to the correct
places in the profile registry keys?

Do the signatures work the next time Outlook is started and after that or
are you saying that the values are being changed after you set them?

Outlook only reads those values as far as I know when it starts up.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"JK" wrote in message
...
Hi
I try to set default signature through code (C# & VS 2008), it
successfully
writes 'New Signature' and 'Reply/Forward Signature' values in a registry.
When I open New mail or reply to any email, my signature does not appear.
I have to restart outlook everytime after setting Default Signature.
Is there any way that I can see my signature in New Email without
restarting
the outlook?
Please help me out!!
JK



  #4  
Old May 12th 08, 01:59 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Set Default Signature in Outlook 2007

You are out of luck. Outlook will only read those values from the registry
when it starts up. Why not just write the registry values you want during
installation of your code? That way Outlook has the values when it starts
up.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"JK" wrote in message
...
Thanks for your reply Ken.
You are right, it should be 'Reply-Forward Signature'. I just misspelled
it
in the post.
When I set values for the registry in my code, it changes in the
registry..
but the problem is that Outlook reads the values from the registry only on
startup.
I restarted the Outlook thru code..it worked fine but its annoying for the
user.
I dont want to restart Outlook.


  #5  
Old May 12th 08, 02:47 PM posted to microsoft.public.outlook.program_addins
jk
external usenet poster
 
Posts: 43
Default Set Default Signature in Outlook 2007

When user set a signature to default, that time I have to write values to
registry..not during installation. I wonder how it happens when we set a
default signature from Outlook, you open new email..u find the signature.
Microsoft doing the same functionality itself but not letting people to do it
.. :-)

"Ken Slovak - [MVP - Outlook]" wrote:

You are out of luck. Outlook will only read those values from the registry
when it starts up. Why not just write the registry values you want during
installation of your code? That way Outlook has the values when it starts
up.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"JK" wrote in message
...
Thanks for your reply Ken.
You are right, it should be 'Reply-Forward Signature'. I just misspelled
it
in the post.
When I set values for the registry in my code, it changes in the
registry..
but the problem is that Outlook reads the values from the registry only on
startup.
I restarted the Outlook thru code..it worked fine but its annoying for the
user.
I dont want to restart Outlook.



  #6  
Old May 12th 08, 04:01 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Set Default Signature in Outlook 2007

Outlook caches a lot of data that is read on startup and changed in the UI,
then it may or may not update the registry from the cached information then
or at shutdown. However it doesn't read back registry values after startup.
A lot of configuration information is like that.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"JK" wrote in message
...
When user set a signature to default, that time I have to write values to
registry..not during installation. I wonder how it happens when we set a
default signature from Outlook, you open new email..u find the signature.
Microsoft doing the same functionality itself but not letting people to do
it
. :-)


  #7  
Old May 12th 08, 04:35 PM posted to microsoft.public.outlook.program_addins
jk
external usenet poster
 
Posts: 43
Default Set Default Signature in Outlook 2007

Thanks Ken. Shall I inform my management that Outlook has to be restarted
after setting Default Signature? or I should look for some work around.

"Ken Slovak - [MVP - Outlook]" wrote:

Outlook caches a lot of data that is read on startup and changed in the UI,
then it may or may not update the registry from the cached information then
or at shutdown. However it doesn't read back registry values after startup.
A lot of configuration information is like that.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"JK" wrote in message
...
When user set a signature to default, that time I have to write values to
registry..not during installation. I wonder how it happens when we set a
default signature from Outlook, you open new email..u find the signature.
Microsoft doing the same functionality itself but not letting people to do
it
. :-)



  #8  
Old May 12th 08, 06:39 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Set Default Signature in Outlook 2007

You can look around, but I don't know of any workarounds.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"JK" wrote in message
...
Thanks Ken. Shall I inform my management that Outlook has to be restarted
after setting Default Signature? or I should look for some work around.


  #9  
Old May 12th 08, 09:28 PM posted to microsoft.public.outlook.program_addins
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Set Default Signature in Outlook 2007

Here's a possible workaround, from LIsting 17.8 in my book. It probably works only if Word 2007 is installed, because it uses Word's Application.EmailOptions.EmailSignature.EmailSigna tureEntries collection. Code is for VBA and gets information from the GAL to fill out the details of the signature. The juicy EmailSignatureEntries part is near the end.

Dim objOL ' As Outlook.Application
Dim objNS ' As Outlook.NameSpace
Dim blnWeStartedOutlook ' As Boolean
Const olFolderInbox = 6
On Error Resume Next
Set objOL = GetObject(, "Outlook.Application")
If objOL Is Nothing Then
Set objOL = CreateObject("Outlook.Application")
Set objNS = objOL.GetNamespace("MAPI")
objNS.Logon "", "", True, True
' objNS.Logon "Outlook Settings", "", False, True
blnWeStartedOutlook = True
Else
Set objNS = objOL.GetNamespace("MAPI")
objNS.Logon "", "", False, False
End If
If Not objNS.GetDefaultFolder(olFolderInbox) Is Nothing Then
Call CreateSignature(objNS)
Else
MsgBox "Could not start Outlook to set up signature"
End If
If blnWeStartedOutlook Then
objNS.Logoff
objOL.Quit
End If
Set objOL = Nothing
Set objNS = Nothing

Sub CreateSignature(objNS)
Dim objMsg ' As Outlook.MailItem
Dim objDoc ' As Word.Document
Dim objSel ' As Word.Selection
Dim objSig ' As Word.EmailSignature
Dim colSig ' As Word.EmailSignatureEntries
Dim objExUser ' As Outlook.ExchangeUser
Dim objUser ' As Outlook.AddressEntry
Dim strSig ' As String
Dim objInsp ' As Outlook.Inspector
Const olmailitem = 0
Const wdCollapseEnd = 0
Const wdStory = 6
Const olDiscard = 1
Const olMinimized = 1
Set objUser = objNS.CurrentUser.AddressEntry
Set objMsg = objNS.Application.CreateItem(olmailitem)
objMsg.Display
Set objInsp = objMsg.GetInspector
objInsp.WindowState = olMinimized
Set objDoc = objInsp.WordEditor
Set objSel = objDoc.Application.Selection
With objSel
.Move wdStory, -1
.InsertAfter "--" & vbCrLf & Space(3)
.Collapse wdCollapseEnd
.InsertAfter objUser.Name
.Font.Bold = True
.InsertAfter " "
.Collapse wdCollapseEnd
End With
If objUser.AddressEntryUserType = _
olExchangeUserAddressEntry Then
Set objExUser = objUser.GetExchangeUser
If objExUser.Department "" Then
strSig = vbCrLf & Space(3) & objExUser.Department
End If
If objExUser.CompanyName "" Then
strSig = strSig & vbCrLf & Space(3) & _
objExUser.CompanyName
End If
If objExUser.BusinessTelephoneNumber "" Then
strSig = strSig & vbCrLf & Space(3) & _
objExUser.BusinessTelephoneNumber
End If
With objSel
.InsertAfter objExUser.PrimarySmtpAddress
.Font.Bold = False
objDoc.Hyperlinks.Add objSel.Range, _
"mailto:" & objExUser.PrimarySmtpAddress
.Collapse wdCollapseEnd
.InsertAfter strSig
End With
Else
With objSel
.InsertAfter objUser.Address
.Font.Bold = False
objDoc.Hyperlinks.Add objSel.Range, _
"mailto:" & objUser.Address
.Collapse wdCollapseEnd
End With
End If
objSel.InsertAfter vbCrLf
objSel.MoveStart wdStory, -1
objSel.Font.Color = wdColorBlack
Set objSig = _
objDoc.Application.EmailOptions.EmailSignature
Set colSig = objSig.EmailSignatureEntries
colSig.Add objUser.Name, objSel.Range
objSig.NewMessageSignature = objUser.Name
objSig.ReplyMessageSignature = objUser.Name
objInsp.Close olDiscard
Set objMsg = Nothing
Set objDoc = Nothing
Set objSel = Nothing
Set objSig = Nothing
Set colSig = Nothing
Set objExUser = Nothing
Set objUser = Nothing
Set objInsp = nothing
End Sub




--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Ken Slovak - [MVP - Outlook]" wrote in message ...
You can look around, but I don't know of any workarounds.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"JK" wrote in message
...
Thanks Ken. Shall I inform my management that Outlook has to be restarted
after setting Default Signature? or I should look for some work around.


  #10  
Old May 14th 08, 02:25 PM posted to microsoft.public.outlook.program_addins
jk
external usenet poster
 
Posts: 43
Default Set Default Signature in Outlook 2007

thank you very much Sue. It worked for me :-)

"Sue Mosher [MVP-Outlook]" wrote:

Here's a possible workaround, from LIsting 17.8 in my book. It probably works only if Word 2007 is installed, because it uses Word's Application.EmailOptions.EmailSignature.EmailSigna tureEntries collection. Code is for VBA and gets information from the GAL to fill out the details of the signature. The juicy EmailSignatureEntries part is near the end.

Dim objOL ' As Outlook.Application
Dim objNS ' As Outlook.NameSpace
Dim blnWeStartedOutlook ' As Boolean
Const olFolderInbox = 6
On Error Resume Next
Set objOL = GetObject(, "Outlook.Application")
If objOL Is Nothing Then
Set objOL = CreateObject("Outlook.Application")
Set objNS = objOL.GetNamespace("MAPI")
objNS.Logon "", "", True, True
' objNS.Logon "Outlook Settings", "", False, True
blnWeStartedOutlook = True
Else
Set objNS = objOL.GetNamespace("MAPI")
objNS.Logon "", "", False, False
End If
If Not objNS.GetDefaultFolder(olFolderInbox) Is Nothing Then
Call CreateSignature(objNS)
Else
MsgBox "Could not start Outlook to set up signature"
End If
If blnWeStartedOutlook Then
objNS.Logoff
objOL.Quit
End If
Set objOL = Nothing
Set objNS = Nothing

Sub CreateSignature(objNS)
Dim objMsg ' As Outlook.MailItem
Dim objDoc ' As Word.Document
Dim objSel ' As Word.Selection
Dim objSig ' As Word.EmailSignature
Dim colSig ' As Word.EmailSignatureEntries
Dim objExUser ' As Outlook.ExchangeUser
Dim objUser ' As Outlook.AddressEntry
Dim strSig ' As String
Dim objInsp ' As Outlook.Inspector
Const olmailitem = 0
Const wdCollapseEnd = 0
Const wdStory = 6
Const olDiscard = 1
Const olMinimized = 1
Set objUser = objNS.CurrentUser.AddressEntry
Set objMsg = objNS.Application.CreateItem(olmailitem)
objMsg.Display
Set objInsp = objMsg.GetInspector
objInsp.WindowState = olMinimized
Set objDoc = objInsp.WordEditor
Set objSel = objDoc.Application.Selection
With objSel
.Move wdStory, -1
.InsertAfter "--" & vbCrLf & Space(3)
.Collapse wdCollapseEnd
.InsertAfter objUser.Name
.Font.Bold = True
.InsertAfter " "
.Collapse wdCollapseEnd
End With
If objUser.AddressEntryUserType = _
olExchangeUserAddressEntry Then
Set objExUser = objUser.GetExchangeUser
If objExUser.Department "" Then
strSig = vbCrLf & Space(3) & objExUser.Department
End If
If objExUser.CompanyName "" Then
strSig = strSig & vbCrLf & Space(3) & _
objExUser.CompanyName
End If
If objExUser.BusinessTelephoneNumber "" Then
strSig = strSig & vbCrLf & Space(3) & _
objExUser.BusinessTelephoneNumber
End If
With objSel
.InsertAfter objExUser.PrimarySmtpAddress
.Font.Bold = False
objDoc.Hyperlinks.Add objSel.Range, _
"mailto:" & objExUser.PrimarySmtpAddress
.Collapse wdCollapseEnd
.InsertAfter strSig
End With
Else
With objSel
.InsertAfter objUser.Address
.Font.Bold = False
objDoc.Hyperlinks.Add objSel.Range, _
"mailto:" & objUser.Address
.Collapse wdCollapseEnd
End With
End If
objSel.InsertAfter vbCrLf
objSel.MoveStart wdStory, -1
objSel.Font.Color = wdColorBlack
Set objSig = _
objDoc.Application.EmailOptions.EmailSignature
Set colSig = objSig.EmailSignatureEntries
colSig.Add objUser.Name, objSel.Range
objSig.NewMessageSignature = objUser.Name
objSig.ReplyMessageSignature = objUser.Name
objInsp.Close olDiscard
Set objMsg = Nothing
Set objDoc = Nothing
Set objSel = Nothing
Set objSig = Nothing
Set colSig = Nothing
Set objExUser = Nothing
Set objUser = Nothing
Set objInsp = nothing
End Sub




--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Ken Slovak - [MVP - Outlook]" wrote in message ...
You can look around, but I don't know of any workarounds.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"JK" wrote in message
...
Thanks Ken. Shall I inform my management that Outlook has to be restarted
after setting Default Signature? or I should look for some work around.



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Set Default Signature Ben Outlook and VBA 4 March 1st 07 12:22 PM
Auto add outlook default signature Kevin Outlook - Using Forms 5 November 25th 06 03:18 AM
Detect default signature paul Outlook and VBA 1 September 15th 06 05:37 AM
Not able to add default Signature antonio Outlook and VBA 5 May 12th 06 06:32 AM
setting signature as default drmeh Outlook and VBA 0 March 6th 06 12:59 AM


All times are GMT +1. The time now is 09:18 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.