Sub mail() '----------------------------------------- 'DECLARE AND SET VARIABLES Dim otlApp As Object Dim OtlNewMail As Object Dim Signature As String Set otlApp = CreateObject("Outlook.Application") Set OtlNewMail = otlApp.CreateItem(olMailItem) '----------------------------------------- 'GET DEFAULT EMAIL SIGNATURE Signature = Environ("appdata") & "\Microsoft\Signatures\" If Dir(Signature, vbDirectory) <> vbNullString Then Signature = Signature & Dir$(Signature & "*.htm") Else Signature = "" End If Signature = CreateObject("Scripting.FileSystemObject").GetFile(Signature).OpenAsTextStream(1, -2).ReadAll '----------------------------------------- 'CREATE EMAIL 'OtlNewMail.HTMLBody = Signature With OtlNewMail .To = menopriezvisko@.firma.sk .CC = "" .Subject = "dodatok do MOSu!" .HTMLBody = "<HTML><BODY><P STYLE='font-family:Times New Roman;font-size:16'>Dobrý deň!<br>Prosím o nahodenie dodatku do MOSu!<br>Ďakujem. <br></ p> " & Signature .Display '.Send End With '----------------------------------------- 'CLEANUP Set OtlNewMail = Nothing Set otlApp = Nothing End Sub
Sub FixParagraphSpacing() Dim objOL As Application Dim objDoc As Object Dim objSel As Object Set objOL = Application Set objDoc = objOL.ActiveInspector.WordEditor Set objSel = objDoc.Windows(1).Selection objSel.ParagraphFormat.SpaceBefore = 0 objSel.ParagraphFormat.SpaceBeforeAuto = False objSel.ParagraphFormat.SpaceAfter = 0 objSel.ParagraphFormat.SpaceAfterAuto = False Set objOL = Nothing Set objDoc = Nothing Set objSel = Nothing End Sub
Sub mail() Set msg = Application.CreateItemFromTemplate("C:\Users\meno\AppData\Roaming\Microsoft\Templates\template.oft") msg.Display End Sub
Outlook 2007-VBA-nepridávať medzery VYRIEŠENÉ