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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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