Jump to content
СофтФорум - всё о компьютерах и не только

Sendto из VisualBasic


Recommended Posts

Юзал поиск, но ничего не нашел. Вопрос в следующем. Как из VisualBasic отправить файл по электронке?

Нужно чтобы было так, как будто пользователь выбрал в контекстном меню винды "Отправить-Адресат".

После чего запустилась прога установленная по умолчанию для отсылки почты.

Знаю, что это возможно и знаю, что довольно просто, но просто сейчас нет под рукой MSDN.

Подскажите. Если можно с примером.

Заранее спасибо.

Link to comment
Share on other sites

Нашел.

Вот примерный код.

Public Const MAPI_USER_ABORT = 1Public Const SUCCESS_SUCCESS = 0Public Declare Function MAPISendDocuments Lib "MAPI32.DLL" (ByVal UIParam&, ByVal DelimStr$, ByVal FilePaths$, ByVal FileNames$, ByVal Reserved&) As Longdim sDir as Stringdim NameFile as StringSub SendFile()sDir="c:\test"NameFile="test.txt"Select Case MAPISendDocuments(0, ";", sDir + "\" + NameFile, NameFile, 0)	  Case SUCCESS_SUCCESS		   MsgBox "Файл успешно отправлен.", vbOKOnly	  Case MAPI_USER_ABORT		   MsgBox "Вы отменили отправку. ", vbCritical	  Case Else		   MsgBox "Ошибка отправки файла. ", vbCriticalEnd SelectEnd Sub
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...