Outlook Mail with Signatures

StyvieStyvie Member Posts: 77
Hi ,

Has anyone had any luck with creating Outlook mail messages from inside Navision - and having the mail created with the Signature.

I cannot get this to work , despite many VB samples managing to get it done. (My solution falls over where they use Objects - i tried Variants, the correct object type etc... still no luck).

Is there a simple solution ?

PS. I do not know which signature I want before i run the function... the users default signature must appear on the mail...

Thanks

Comments

  • ngebhardngebhard Member Posts: 127
    I would be interested in a solution of this "problem" as well. If anyone has any ideas...

    Greetz,
    N. Gebhard
    ProTAKT Projekte & Business Software AG
    Microsoft Dynamics NAV Partner
    Bad Nauheim, Germany
    http://www.protakt.de
    http://twitter.com/protakt
  • Morten_SolbergMorten_Solberg Member Posts: 24
    Search the forum for SIGNATURE

    or: http://www.mibuso.com/forum/viewtopic.php?t=4650

    best regards, Morten
  • StyvieStyvie Member Posts: 77
    Nice idea, but does not help me...

    I am creating mails for distribution to many contacts, and need to programatically add messages, attachments etc. Hence I need programatic access to do this...

    I am wrapping Outlook in my own Automation variable to acheive this....
  • Dmitry_ChadaevDmitry_Chadaev Member Posts: 52
    How about this:

    E-mail signatures are usually stored as files on your machine: C:\Documents and Settings\YourUserName\Application Data\Microsoft\Signatures.

    You could just access txt file stored there and add it to your message in codeunit 397:
    OSendMail."To" := ToName;
          OSendMail.CC := CCName;
          OSendMail.Subject := Subject;
    
          IF ISCLEAR(BSTRConverterBody) THEN
            CREATE(BSTRConverterBody);
    
          // ---- New Code
    
          ChrLineBreak := 13;
          Signature.TEXTMODE(TRUE);
    
          IF Signature.OPEN('C:\Main Signature.txt') // Define path to txt signature file
            THEN BEGIN
              AddBodyline(FORMAT(ChrLineBreak));
    
              WHILE NOT (Signature.POS = Signature.LEN) DO BEGIN
                Signature.READ(MyText);
                AddBodyline(MyText);
                AddBodyline(FORMAT(ChrLineBreak));
              END;
          END;
    
          // ---- New Code
    
          IF Body <> '' THEN BEGIN
            BSTRConverterBody.ResetBSTR;
            BSTRConverterBody.AppendNextStringPortion(Body);
          END;
    

    To make it more generic - the path could probably be stored on a Salesperson Card somewhere... Just an idea :)
    Best regards,
    Dmitry
  • StyvieStyvie Member Posts: 77
    Hey Dimitry,

    Great minds... Actually used something very similar, only issue i had with that method was the fact that the client required the HTML version of the signature to be present, so i wrapped the Outlook obs as an Automation var.. not the most elegant solution, but gives me access to HTMLBody property.

    Works like a charm,

    Thanks for the response though.. will be useful for someone.... now if I could just figure out how Outlook knows which signature is chosen for Standard mails vs replies, it would be perfect, then would not even need the setup on User Setup.

    Regards,
    Steve
  • bhdijkstrabhdijkstra Member Posts: 13
    this isn't working for me, does anyone know how to make a change within Outlook for example?
  • infonoteinfonote Member Posts: 233
    Hi,

    I require something similar i.e. Signature with HTML.
    I am having a look at the Outlook OBS, but none have the HTMLBody property.

    Classes
    OutlookBarShortcut
    OutlookBarShortcuts
    OutlookBarStorage

    Alternatively has anyone found an alternative/better method to do this?

    Thanks in advance
    Styvie wrote:
    Hey Dimitry,

    Great minds... Actually used something very similar, only issue i had with that method was the fact that the client required the HTML version of the signature to be present, so i wrapped the Outlook obs as an Automation var.. not the most elegant solution, but gives me access to HTMLBody property.

    Works like a charm,

    Thanks for the response though.. will be useful for someone.... now if I could just figure out how Outlook knows which signature is chosen for Standard mails vs replies, it would be perfect, then would not even need the setup on User Setup.

    Regards,
    Steve
Sign In or Register to comment.