Consulting

Results 1 to 15 of 15

Thread: Signatures

  1. #1
    VBAX Regular
    Joined
    Oct 2005
    Posts
    19
    Location

    Signatures

    HiDoes anyone know if theres a way of prompting the user to add a signature or not? We are currently upgrading to Outlook 2003 from GroupWise 5.5 and in GroupWise you have the option to prompt you to insert a signature when you click send (on any new reply or forward mail) on it asks you to either add or dont add signature, which a lot of people found useful. Is there anyway of doing this in Outlook even using VBA??ThanksSteve

  2. #2
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    Quote Originally Posted by steve
    ...We are currently upgrading to Outlook 2003 from GroupWise 5.5 ...
    Uh... upgrading? I use both products daily (Groupwise at work, Outlook at home) and to my mind, Groupwise will actually do FAR more than Outlook, no question.

    From being it's own mail server, to document library management to the actual email itself, Groupwise wins in sheer capabilities. Outlook's only advantage is that it's a little more mainstream, and that it integrates tightly with the office suite. To get the rest of the features that Groupwise has, you'll need to add an exchange server at a mimimum.

    Regardless, as far as signatures go, I don't know if I can help you there... I know the feature you mean in Groupwise, but I just set up Outlook to tag it. I almost always use one, and never checked to see if there was a prompting feature. Curious to know myself, now that you mention it. If no one else answers, I'll dig around a little when I get home tonight.

    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  3. #3
    I'm only running Outlook 2000, but I cannot find a similar feature. You can either set it to automatically add a default signature all the time (except maybe on forwards and replies), or you can leave the setting off and do it yourself by selectin Insert / Signature from the menu each time you create a new email.

    As far as programming a feature like this, it is possible. Outlook doesn't provide programatic access to the saved signatures created by your user profile, but it does provide access to the Insert menu you use to add one.

    The following code works in Outlook 2000, although it may need adjustments for 2003 if the menus are any different. To use it, open Outlook, open the VB Editor (ALT+F11), double-click ThisOutlookSession, and paste the code.
    [VBA]
    ' Code for signature prompt on new email messages

    Private WithEvents myOlInspectors As Outlook.Inspectors ' Inspectors collection
    Private WithEvents myOlInspector As Outlook.Inspector ' New inspector

    ' Assign Inspectors collection to catch events
    Private Sub Application_Startup()
    Set myOlInspectors = Application.Inspectors
    End Sub

    ' Assign newly created Inspector to catch Activate event
    Private Sub myOlInspectors_NewInspector(ByVal Inspector As Outlook.Inspector)
    If Inspector.CurrentItem.Class = olMail Then Set myOlInspector = Inspector
    End Sub

    ' Prompt user to consider adding a signature
    Private Sub myOlInspector_Activate()
    Dim result As Integer ' Store user response from prompt
    DoEvents ' Give inspector window time to load
    result = MsgBox("Would you like to add a signature to this email?", vbYesNo, "Add Signature?")
    If result = vbYes Then _
    myOlInspector.CommandBars("Menu Bar").Controls("Insert").Controls("Signature").Controls("More...").Execute
    Set myOlInspector = Nothing ' Prevent Outlook from acting on Activate event from this Inspector again
    End Sub

    Private Sub Application_Quit()
    Set myOlInspectors = Nothing ' Remove reference to Inspectors collection
    End Sub
    [/VBA]

  4. #4
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    Hi Chocobochick,

    I gave this a shot in 2003, but can't see that it made any difference. One question as I have signatures tagged automatically... will it be ignored if the signatures are already active?
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  5. #5
    VBAX Regular
    Joined
    Oct 2005
    Posts
    19
    Location
    Hi

    Chocobochick - Thanks for the code, gave it a try today and nothing happened. When I sent the e-mail it didnt prompt to add the signature. Any ideas?

    Kpuls - I personally have always been a fan of Outlook, but that was before I realised quite how much GroupWise can do! Although this seems like a silly little function its suprising how handy it is and how many people use it. I shall keep working on it.

  6. #6
    As it happens I have a signature request as well! We occasionally want to print off some of our custom forms but since virtually everyone here has an automatic signature insertion we're getting signatures at the bottom of the prints. In fact for some reason I haven't fathomed, we're getting two copies of the signature.

    It's no biggy, but is there not some way of completly surpressing the signature? I would have thought it was added to the Message field but these forms don't have one (it was deleted during design) so where is this sig coming from?

    Jon

  7. #7
    I had the opportunity to browse Outlook 2003 on an XP machine today, and the Insert / Signatures command is not there on the menu, rendering my code useless for that machine. However, I think I saw a similar command available from the Options dropdown in the Email toolbar. Perhaps someone with more available access to Outlook 2003 can adjust the line in my code to work with this.

    As far as suppressing printed signatures, I'm not sure there are any simple options. I'm not sure where they're appearing on your custom forms, but the signatures get placed into the Body property (and possibly HTMLBody property) of a MailItem object, and once it's there, there's no way to differentiate between it and any other manually typed text.

  8. #8
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    Heya Chocobo,

    I'm not much of an Outlook coder, but I'll see if I can sleuth around in it a bit when I get the chance.
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  9. #9
    This line:
    [VBA]
    myOlInspector.CommandBars("Menu Bar").Controls("Insert").Controls("Signature").Controls("More...").Execute
    [/VBA]

    ...needs to be changed in the above code to match the location of the Signature button in the Email toolbar. The strings in Quotes just have to match the caption used for each step of the process, so it would probably look something like:
    [VBA]
    myOlInspector.CommandBars("Email").Controls("Options...").Controls("Signatu re").Execute
    [/VBA]

  10. #10
    Thanks Choco. However, if I want no signature, wouldn't that mean setting everyone up with a blank signature to choose?

    I'm closer by addressing the HTMLBody property. Unfortunately, setting this to "" on the Open event isn't working because the Sig is being added after this open event (tested by setting HTMLBody to some text - it appears beneath the sig).

    I can cure my other custom form (where the body isn't actually used) by setting it to "" on closing but I had planned to use the Body in this one so that wouldn't be a useful option

    I'll do some more playing. Thanks for the help so far - keep it coming!

    Jon

  11. #11
    VBAX Regular
    Joined
    Oct 2005
    Posts
    19
    Location
    Hi Choco!

    I've done what you said and it doesnt work! It doesnt prompt me to add a signature at all just sends the e-mail!

    Thanks for your help so far!

    Steve

  12. #12
    Oops. I neglected to mention that you will need to completely close and restart Outlook after you've pasted the code.

  13. #13
    VBAX Regular
    Joined
    Oct 2005
    Posts
    19
    Location
    Done that...Still not working. Just to check I opened VBA editor double clicked ThisOutlookSession and just pasted the code in there (see attached screen shot)

    Thanks
    Steve

  14. #14
    The code is not going to properly bring up your sig options in Outlook 2003 (someone else will need to post the corrected code for that), but you should at least be getting the prompt displayed each time you hit the New Mail Message button. If you're not getting the prompt, Outlook may have macro settings disabled.

  15. #15
    VBAX Regular
    Joined
    Oct 2005
    Posts
    19
    Location
    Opps does help if I sent the Macro security to medium!

    Works perfectly now thanx

    Steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •