Outlook integration error

anupanup Member Posts: 19
hi all,

I am running a simple test codeunit which mails report o/p (.html file) as an attachment.

After running the codeunit, Navision gets closed.
can somebody tell me what's the problem with following codeunit ??


IF REPORT.SAVEASHTML(5060, 'D:/Anuradha/Test report', FALSE) THEN BEGIN
MESSAGE('Successfully saved');
IF NOT Mail.NewMessage('e-mail address','','Test report','',
'D:/Anuradha/Test Report',TRUE) THEN
ERROR('Mail not sent');
MESSAGE('Not saved');


  • Options
    Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    What message do you get?

    When I run the codeunit I have to replace the 'D:/Anuradha/Test report' for 'C:\test.html'

    Then after changing the emailadres for a valid address it works like a charm
  • Options
    anupanup Member Posts: 19
    I get following error -

    "Microsoft Business Solution Navision has encountered an error and needs to be closed"

    getting same error for following code -

    REPORT.SAVEASHTML(5060, 'C:\test.html');

    ToName := 'valid e-mail address';
    CCName := '';
    Subject := 'Test report';
    Body := 'Test report';
    AttachFileName := 'C:\test.html';
    OpenDialog := TRUE;

  • Options
    Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Does it happen on all computers or on just one? It looks like something is wrong with the installation of either navision or outlook.
  • Options
    anupanup Member Posts: 19
    that i have to check out.... i also get error while running ' synchronize with outlook ' function, saying wrong profile name.....

    will get back after checking on another computer.

  • Options
    anupanup Member Posts: 19
    it's working on other PC, so problem is with my outlook..
    but i have to manually press send, mail is not going automatically...

    by the way which outlook/express version is most suitable for 4.0 ??

  • Options
    gavrishanchorgavrishanchor Member Posts: 10
    To post automatically assign false to OpenDialog.
Sign In or Register to comment.