Private Sub CommandButton1_Click() If WebBrowser1.Document.all("txtList").Value = "" Then MsgBox "No files have been uploaded" + vbNewLine + "Please make sure you click on 'Start upload' and upload is 100% completed" Else On Error GoTo MessageACT Set objMail = Outlook.Application.ActiveInspector.CurrentItem If objMail.BodyFormat = olFormatHTML Then ' objMail.HTMLBody = objMail.HTMLBody + "<hr>Attached" + Attachment1 incMess = "" Attachment1 = WebBrowser1.Document.all("txtList").Value Expires1 = WebBrowser1.Document.all("txtDate").Value preText = "<font size=1>------------------------------------</font><br><b>Large Attachments</b><br>" + vbNewLine posttext = vbNewLine + "<br><font size=1>Attachments added via filesharingserverindmz.cool <br> powered by owners </font><br>-------------------" filesAtt = Split(Attachment1, "|") For Each itm In filesAtt If itm <> "" Then ATTmsg = ATTmsg + "<a href='https://filesharingserverindmz.cool/get/" + itm + "'>https://filesharingserverindmz.cool/get/" + itm + "</a><br>" + vbNewLine End If Next itm incMess = preText + ATTmsg + vbNewLine + "<br>the attachments will be valid for <b>" + Expires1 + "</b> days from now" + vbNewLine + posttext objMail.HTMLBody = vbNewLine + incMess + objMail.HTMLBody Else incMess = "" Attachment1 = WebBrowser1.Document.all("txtList").Value Expires1 = WebBrowser1.Document.all("txtDate").Value preText = "------------------------------------" + vbNewLine + " Large Attachments " + vbNewLine posttext = vbNewLine + " Attachments added via filesharingserverindmz.cool " + vbNewLine + "powered by owners " + vbNewLine + "------------------------------------" filesAtt = Split(Attachment1, "|") For Each itm In filesAtt If itm <> "" Then ATTmsg = ATTmsg + "https://filesharingserverindmz.cool/get/" + itm + vbNewLine End If Next itm incMess = preText + ATTmsg + vbNewLine + "the attachments will be valid for " + Expires1 + " days from now" + vbNewLine + posttext objMail.Body = vbNewLine + incMess + objMail.Body End If Unload Me End If Exit Sub MessageACT: MsgBox "This button only works when composing email messages" End Sub Private Sub CommandButton2_Click() incMess = "" Attachment1 = WebBrowser1.Document.all("txtList").Value Expires1 = WebBrowser1.Document.all("txtDate").Value preText = "------------------------------------<br><b>Large Attachments</b><br>" + vbNewLine posttext = vbNewLine + "<br><font size=1>Attachments added via filesharingserverindmz.cool <br> powered by UNICEF Geneva ITSSD </font><br>------------------------------------" filesAtt = Split(Attachment1, "|") For Each itm In filesAtt If itm <> "" Then ATTmsg = ATTmsg + "<a href='https://filesharingserverindmz.cool/get/" + itm + "'>https://filesharingserverindmz.cool/get/" + itm + "</a><br>" + vbNewLine End If Next itm incMess = preText + ATTmsg + vbNewLine + "<br>the attachments will be valid for <b>" + Expires1 + "</b> days from now" + vbNewLine + posttext LargeAttachments.WebBrowser1.Document.Body.innerHTML = "<body><font style='font-size:11px'>" + incMess + "</font></body>" LargeAttachments.Show End Sub Private Sub CommandButton3_Click() WebCode1.Visible = True CommandButton2.Visible = True CommandButton1.Visible = False WebBrowser1.Visible = False WebCode1.Navigate2 "https://filesharingserverindmz.cool/uploader/upload/plugin/upload.php" incMess = "" Attachment1 = WebBrowser1.Document.all("txtList").Value Expires1 = WebBrowser1.Document.all("txtDate").Value preText = "------------------------------------<br><b>Large Attachments</b><br>" + vbNewLine posttext = vbNewLine + "<br><font size=1>Attachments added via filesharingserverindmz.cool <br> powered by UNICEF Geneva ITSSD </font><br>------------------------------------" filesAtt = Split(Attachment1, "|") For Each itm In filesAtt If itm <> "" Then ATTmsg = ATTmsg + "<a href='https://filesharingserverindmz.cool/get/" + itm + "'>https://filesharingserverindmz.cool/get/" + itm + "</a><br>" + vbNewLine End If Next itm incMess = preText + ATTmsg + vbNewLine + "<br>the attachments will be valid for <b>" + Expires1 + "</b> days from now" + vbNewLine + posttext WebCode1.Document.Body.innerHTML = "<html><body><font style='font-size:11px'>" + incMess + "</font></body></html>" WebCode1.SetFocus End Sub Private Sub UserForm_Activate() LargeAttachments.WebBrowser1.Navigate2 "about:blank" WebBrowser1.Navigate2 "https://filesharingserverindmz.cool/uploader/upload/plugin/upload.php" End Sub
Sub Attachment() LargeAttachments.Show End Sub
Source: https://habr.com/ru/post/204708/
All Articles