Hallo,
ich habe ein kleines problem mit meiner E-Mail Signatur und zwar rufe ich diese aus dem AD ab.. alles schön und gut.
Ich habe zwei Arten... eine mit HTML und Tabellen und eine normale ohne HTML und Tabellen.
Bei der ohne HTML kann ich Bilder einbinden und diese werden auch überall mit hinversendet, auch auf Smartphones. Da diese aber auf Smartphones nicht schön dargestellt wird wollte ich das mit HTML und Tabellen lösen. Allerdings bekomme ich da die Bilder (Logos) nicht richtig mitverschickt, da sie beim Empfänger dann nicht dagestellt werden.
Nun will ich entweder in dem Code ohne HTML eine Tabelle haben oder in dem Code mit HTML die Logos vernüpftig.
Wer kann mir da helfen??
Hier einmald er Code ohne HTML:
Hier der Code mit HTML:
und nun bitte bitte bitte eine lösung... ich verzweifle dran
ich habe ein kleines problem mit meiner E-Mail Signatur und zwar rufe ich diese aus dem AD ab.. alles schön und gut.
Ich habe zwei Arten... eine mit HTML und Tabellen und eine normale ohne HTML und Tabellen.
Bei der ohne HTML kann ich Bilder einbinden und diese werden auch überall mit hinversendet, auch auf Smartphones. Da diese aber auf Smartphones nicht schön dargestellt wird wollte ich das mit HTML und Tabellen lösen. Allerdings bekomme ich da die Bilder (Logos) nicht richtig mitverschickt, da sie beim Empfänger dann nicht dagestellt werden.
Nun will ich entweder in dem Code ohne HTML eine Tabelle haben oder in dem Code mit HTML die Logos vernüpftig.
Wer kann mir da helfen??
Hier einmald er Code ohne HTML:
Brainfuck-Quellcode
- On Error Resume Next
- ' Objects
- Set objSysInfo = CreateObject("ADSystemInfo")
- Set WshShell = CreateObject("WScript.Shell")
- Set objUser = GetObject("LDAP://" & objSysInfo.UserName)
- Set objWord = CreateObject("Word.Application")
- Set objFSO = CreateObject("Scripting.FileSystemObject")
- ' Signature stuff
- strName = objUser.givenName + " " + objUser.sn
- strDepart = objUser.Department
- strDesc = objUser.Description
- strStreet = objUser.StreetAddress
- strLocation = objUser.l
- strPostCode = objUser.PostalCode
- strPhone = objUser.TelephoneNumber
- strMobile = objUser.Mobile
- strFax = objUser.FacsimileTelephoneNumber
- strEmail = objUser.mail
- strCompany = objUser.Company
- strCompanyWeb2 = "link...."
- aQuote = Chr(34)
- aNewLine = Chr(11)
- strLogo="bild pfad 1"
- strLogo1="bild pfad 2"
- If strCompany = "Firma" then
- strCompanyTitle = "Firma"
- strCompanyWeb = "link"
- Else
- strCompanyTitle = "oder andere Firma"
- strCompanyWeb = "anderer Link"
- End If
- Set objDoc = objWord.Documents.Add()
- Set objSelection = objWord.Selection
- Set objEmailOptions = objWord.EmailOptions
- Set objSignatureObject = objEmailOptions.EmailSignature
- Set objSignatureEntries = objSignatureObject.EmailSignatureEntries
- objSelection.Font.Name = "Arial"
- objSelection.Font.Size = 10
- objSelection.TypeText "Mit freundlichen Grüßen" +aNewLine
- objSelection.TypeText vbCrLf
- objSelection.Font.Bold = True 'Bold
- if (strCred) Then objSelection.TypeText strCred & strName Else objSelection.TypeText strName
- objSelection.TypeText aNewLine
- objSelection.Font.Bold = False 'Bold ende
- objSelection.TypeText "(" & strDepart & ")" + aNewLine
- objSelection.TypeText "__________________________________________________" + aNewLine
- 'Firmanlogo + Anschrift
- objDoc.Range.Font.Color =RGB(0,0,0)
- objSelection.InlineShapes.AddPicture(strLogo)
- objSelection.TypeText aNewLine
- objSelection.TypeText strCompanyTitle +aNewLine
- objSelection.TypeText strStreet & aNewLine
- objSelection.TypeText strPostCode & " " & strLocation
- objSelection.TypeText vbCrLf
- objSelection.TypeText "Telefon: " & "+49 (0) " & strPhone & " "
- objSelection.TypeText "E-Mail: "
- objDoc.Hyperlinks.Add objSelection.Range, "Mailto:" & strEmail, , , strEmail +aNewLine
- if (strFax) Then objSelection.TypeText "Fax: " & "+49 (0) " & strFax & " "
- objSelection.TypeText "Website: "
- objDoc.Hyperlinks.Add objSelection.Range, strCompanyWeb, , ,strCompanyWeb +aNewLine
- if (strMobile) Then objSelection.TypeText "Mobil: " & strMobile & aNewLine
- objSelection.TypeText "Vorstand: ...." +aNewLine
- objSelection.TypeText "Aufsichtsrat: ..."
- objSelection.TypeText vbCrLf
- objSelection.TypeText "Amtsgericht Tostedt: ....." +aNewLine
- objSelection.TypeText "Umsatzsteueridentifikationsnummer: ....." +aNewLine
- objSelection.TypeText "__________________________________________________"
- objSelection.TypeText vbCrLf
- 'Senat der Wirtschaft
- objSelection.TypeText "............."
- objSelection.TypeText vbCrLf
- objSelection.InlineShapes.AddPicture(strLogo1)
- objSelection.TypeText vbCrLf
- objSelection.Font.Underline = True
- objSelection.TypeText ".....:"
- objSelection.Font.Underline = False
- objSelection.TypeText " "
- objSelection.Font.Underline = True
- objSelection.TypeText"...:" +aNewLine
- objSelection.Font.Underline = False
- objSelection.TypeText "..."
- objSelection.TypeText " "
- objSelection.TypeText "..." +aNewLine
- objSelection.TypeText "...."
- objSelection.TypeText " "
- objSelection.TypeText "..." +aNewLine
- objSelection.TypeText "..."
- objSelection.TypeText " "
- objSelection.TypeText "..." +aNewLine
- objSelection.TypeText "Telefon: ..."
- objSelection.TypeText " "
- objSelection.TypeText "Telefon: ...." +aNewLine
- objSelection.TypeText "Fax: ...."
- objSelection.TypeText " "
- objSelection.TypeText "Fax: ..." +aNewLine
- objSelection.TypeText vbCrLf
- objSelection.Font.Underline = True
- objSelection.TypeText "...:" +aNewLine
- objSelection.Font.Underline = False
- objSelection.TypeText "... ... ..." +aNewLine
- objSelection.TypeText "... ..." +aNewLine
- objSelection.TypeText "... ..." +aNewLine
- objSelection.TypeText "Telefon: ...." +aNewLine
- objSelection.TypeText "Fax: ..." +aNewLine
- objSelection.TypeText "Website: "
- objDoc.Hyperlinks.Add objSelection.Range, strCompanyWeb2, , ,strCompanyWeb2 +aNewLine
- objSelection.TypeText "__________________________________________________"
- objDoc.Range.Font.Color =RGB(0,0,0)
- objSelection.TypeText vbCrLf
- 'Rechtliches
- objSelection.Font.size = "8" 'Schriftfarbe on
- objSelection.Font.Color = RGB(0,0,255) 'Schriftfarbe on
- objSelection.TypeText "Diese E-Mail und alle Anhänge enthalten vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder" +aNewLine
- objSelection.TypeText "die E-Mail irrtümlich erhalten haben, informieren Sie bitte unverzüglich den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die" +aNewLine
- objSelection.TypeText "unbefugte Weitergabe dieser Mail ist nicht gestattet." +aNewLine
- objSelection.TypeText "Die CO.NET Verbrauchergenossenschaft eG haftet weder für infolge elektronischer Übertragung entstandene Fehler gleich welcher Art noch für Verlust oder Schaden," +aNewLine
- objSelection.TypeText "den eine Person als Folge dieser E-Mail und/oder ihrer Anhänge dadurch erleidet, dass sie an einen anderen als den beabsichtigten Adressaten übermittelt wurde." +aNewLine
- objSelection.TypeText "Vielen Dank." +aNewLine
- objSelection.Font.Color = 0 'Schriftfarbe off
- objSelection.Font.Name = "Webdings" 'Schriftart anders
- objSelection.Font.Color = RGB(51,153,0) 'Schriftfarbe on
- objSelection.Font.Bold = True
- objSelection.TypeText "P "
- objSelection.Font.Name = "Arial"
- objSelection.TypeText "Im Interesse unserer Umwelt: Bitte prüfen Sie, ob diese E-Mail ausgedruckt werden muss." +aNewLine
- objSelection.Font.Color = 0 'Schriftfarbe off
- objSelection.Font.Bold = False
- objSelection.Font.Color = RGB(0,0,255) 'Schriftfarbe on
- objSelection.TypeText +aNewLine
- objSelection.TypeText "This email and any attached files may contain confidential and/or privileged informations. If you are not the intended recipient (or have received this email in error)" +aNewLine
- objSelection.TypeText "please notify the sender immediately and destroy this email. Any unauthorised copying, disclosure or distribution of the material in this email is strictly forbidden." +aNewLine
- objSelection.Font.Color = 0 'Schriftfarbe off
- objSelection.Font.Name = "Webdings" 'Schriftart anders
- objSelection.Font.Color = RGB(51,153,0) 'Schriftfarbe on
- objSelection.Font.Bold = True
- objSelection.TypeText "P "
- objSelection.Font.Name = "Arial"
- objSelection.TypeText "Before you print - think about the environment." +aNewLine
- objSelection.Font.Color = 0 'Schriftfarbe off
- objSelection.Font.Bold = False
- objSelection.TypeText vbCrLf
- 'Speichern
- Set objSelection = objDoc.Range()
- ' full signature
- objSignatureEntries.Add "_Signature", objSelection
- objSignatureObject.NewMessageSignature = "_Signature"
- objDoc.Saved = True
- ' reply signature
- objSignatureEntries.Add "_Reply_Signature", objSelection
- objSignatureObject.ReplyMessageSignature = "_Reply_Signature"
- objDoc.Saved = True
- ' EOF
Hier der Code mit HTML:
HTML-Quellcode
- Set oWSH = CreateObject("WScript.Shell")
- fsDateiPfad = oWSH.ExpandEnvironmentStrings("%APPDATA%\")
- fsDateiPfad = fsDateiPfad & "Microsoft"
- folder = fsDateiPfad
- Set fso = CreateObject("Scripting.FileSystemObject")
- If fso.FolderExists(folder) Then 'Office installed
- 'msgbox("office installed")
- Set objSysInfo = CreateObject("ADSystemInfo")
- strUser = objSysInfo.UserName
- Set objUser = GetObject("LDAP://" & strUser)
- strMail = objUser.mail
- if strMail <> "" then 'Mailadr set
- 'Check Signature Dir exist or make it
- folder = fsDateiPfad & "\Signatures\"
- If fso.FolderExists(folder) Then 'Signatures Dir exist
- fsDateiPfad = ""
- 'msgbox("SigDir exist")
- else
- fso.CreateFolder(folder)
- 'msgbox("SigDir not exist - [" & folder & "]")
- end if
- 'Get lokal APPDATA
- Set oWSH = CreateObject("WScript.Shell")
- fsDateiPfad = oWSH.ExpandEnvironmentStrings("%APPDATA%\")
- fsDateiPfad = fsDateiPfad & "Microsoft\Signatures\"
- 'Get AccDetails
- AccName = objUser.samAccountName
- strName = objUser.givenName
- strSurname = objUser.sn
- strTitle = objUser.title
- strDepartment = objUser.department
- strPhone = objUser.telephoneNumber
- strMobil = objUser.mobile
- strFax= objUser.facsimileTelephoneNumber
- strZip = objUser.postalCode
- strStreet = objUser.streetAddress
- strCity = objUser.l
- strHP = "...."
- strLogo="bildpfad 1"
- strCompany = objUser.Company
- 'strNotes = objUser.Info
- strdescription = objUser.description
- strInitials = objUser.initials
- signatur_conet()
- end if
- end if 'Office installed
- function signatur_conet()
- Set fsDatei = CreateObject("Scripting.FileSystemObject")
- fsDateiName = fsDateiPfad & "Signatur-" & AccName & ".htm"
- fsDatei.CreateTextFile fsDateiName
- Set fsDatei = fsDatei.getfile(fsDateiName)
- Set fsinhalt = fsDatei.OpenAsTextStream(2, -2)
- fsinhalt.write "<html>" & vbLf
- fsinhalt.write "<!-- .... " & strSurname & " " & strName & " -->" & vbLf
- fsinhalt.write "<head>" & vbLf
- fsinhalt.write "</head>" & vbLf
- fsinhalt.write "<body>" & vbLf
- fsinhalt.write "<span style='FONT-FAMILY:""Arial"",""sans-serif"";font-size:10pt'>" & vbLf
- fsinhalt.write "Mit freundlichen Grüßen<br />" & vbLf
- fsinhalt.write "<br />" & vbLf
- if strInitials <> "" then
- fsinhalt.write "<b />" & strInitials & " " & strdescription & " " & strPreName & " " & strName & " " & strSurname & "</b><br />" & vbLf
- else
- fsinhalt.write "<b />" & strdescription & " " & strPreName & " " & strName & " " & strSurname & "</b><br />" & vbLf
- end if
- if strTitle <> "" then
- fsinhalt.write strTitle & " / " & strDepartment & "<br />" & vbLf
- else
- fsinhalt.write strDepartment & "<br />" & vbLf
- end if
- fsinhalt.write "__________________________________________________________________<br /><br />" & vbLf
- fsinhalt.write "<img src=" & strLogo & " width='101' height='66' />"
- fsinhalt.write "<br /><br />" & vbLf
- fsinhalt.write "<table border='0' style='FONT-FAMILY:""Arial"",""sans-serif"";font-size:10pt'; cellspacing=0; cellpadding=0>" & vbLf
- fsinhalt.write " <tr>" & vbLf
- fsinhalt.write " <td colspan='7'>" & strCompany & "</td>" & vbLf
- fsinhalt.write " </tr>" & vbLf
- fsinhalt.write " <tr>" & vbLf
- fsinhalt.write " <td colspan='7'>" & strStreet & "</td>" & vbLf
- fsinhalt.write " </tr>" & vbLf
- fsinhalt.write " <tr>" & vbLf
- fsinhalt.write " <td colspan='7'>" & strZip & " " & strCity & "</td>" & vbLf
- fsinhalt.write " </tr>" & vbLf
- fsinhalt.write " <tr>" & vbLf
- fsinhalt.write " <td colspan='7'> </td>" & vbLf
- fsinhalt.write " </tr>" & vbLf
- if strPhone <> "" then
- fsinhalt.write " <tr>" & vbLf
- fsinhalt.write " <td>Telefon:</td><td> </td><td>+49 (0) " & strPhone & "</td><td width='50'> </td><td>E-Mail:</td><td> </td><td><a href='mailto:" & strMail & "'style='color: #000000'>" & strMail & "</a></td>" & vbLf
- fsinhalt.write " </tr>" & vbLf
- end if
- if strFax <> "" then
- fsinhalt.write " <tr>" & vbLf
- fsinhalt.write " <td>Fax:</td><td> </td><td>+49 (0) " & strFax & "</td><td width='50'> </td><td>Webseite:</td><td> </td><td><a href='http://" & strHP & "'style='color: #000000'>" & strHP & "</a></td>" & vbLf
- fsinhalt.write " </tr>" & vbLf
- end if
- if strMobil <> "" then
- fsinhalt.write " <tr>" & vbLf
- fsinhalt.write " <td>Mobil:</td><td> </td><td>+49 (0) " & strMobil & "</td>" & vbLf
- fsinhalt.write " </tr>" & vbLf
- end if
- fsinhalt.write " </tr>" & vbLf
- fsinhalt.write "</table>" & vbLf
- 'fsinhalt.write "<br />" & vbLf
- fsinhalt.write "__________________________________________________________________<br /><br />" & vbLf
- 'sdw
- fsinhalt.write "................." & vbLf
- fsinhalt.write "<br /><br />" & vbLf
- fsinhalt.write "<table border='0' style='FONT-FAMILY:""Arial"",""sans-serif"";font-size:10pt'; cellspacing=0; cellpadding=0>" & vbLf
- if strPhone <> "" then
- fsinhalt.write " <tr>" & vbLf
- fsinhalt.write " <td>....:</td><td width='50'> </td><td>....:</td>" & vbLf
- fsinhalt.write " </tr>" & vbLf
- end if
- if strFax <> "" then
- fsinhalt.write " <tr>" & vbLf
- fsinhalt.write " <td>....</td><td width='50'> </td><td>....</td>" & vbLf
- fsinhalt.write " </tr>" & vbLf
- end if
- if strPhone <> "" then
- fsinhalt.write " <tr>" & vbLf
- fsinhalt.write " <td>....</td><td width='50'> </td><td>... ...</td>" & vbLf
- fsinhalt.write " </tr>" & vbLf
- end if
- if strFax <> "" then
- fsinhalt.write " <tr>" & vbLf
- fsinhalt.write " <td>... ...</td><td width='50'> </td><td>... ...</td>" & vbLf
- fsinhalt.write " </tr>" & vbLf
- end if
- fsinhalt.write " <tr>" & vbLf
- fsinhalt.write " <td></td><td> </td><td></td>" & vbLf
- fsinhalt.write " </tr>" & vbLf
- if strPhone <> "" then
- fsinhalt.write " <tr>" & vbLf
- fsinhalt.write " <td>Telefon: +49 (0) ....</td><td width='50'> </td><td>Telefon: +49 (0) ....</td>" & vbLf
- fsinhalt.write " </tr>" & vbLf
- end if
- if strFax <> "" then
- fsinhalt.write " <tr>" & vbLf
- fsinhalt.write " <td>Fax:       +49 (0) ...</td><td width='50'> </td><td>Fax:       +49 (0) 3...</td>" & vbLf
- fsinhalt.write " </tr>" & vbLf
- end if
- fsinhalt.write " </tr>" & vbLf
- fsinhalt.write "</table>" & vbLf
- 'fsinhalt.write "<br />" & vbLf
- fsinhalt.write "__________________________________________________________________<br />" & vbLf
- fsinhalt.write "<br />" & vbLf
- fsinhalt.write "<span style='font-size:7.5pt;color:#ee6c14'>Diese E-Mail und alle Anhänge enthalten vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder die E-Mail irrtümlich erhalten haben, informieren Sie bitte unverzüglich den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. Die CO.NET Verbrauchergenossenschaft eG haftet weder für infolge elektronischer Übertragung entstandene Fehler gleich welcher Art noch für Verlust oder Schaden, den eine Person als Folge dieser E-Mail und/oder ihrer Anhänge dadurch erleidet, dass sie an einen anderen als den beabsichtigten Adressaten übermittelt wurde. Vielen Dank.</span>" & vbLf
- fsinhalt.write "<br />" & vbLf
- fsinhalt.write "<SPAN style='FONT-FAMILY:""Webdings"";color:#009900;font-size:13pt'>P </SPAN><span style='FONT-FAMILY:""Arial"";color:#009900;font-size:7.5pt'><b>Im Interesse unserer Umwelt: Bitte prüfen Sie, ob diese E-Mail ausgedruckt werden muss.</b></span>" & vbLf
- fsinhalt.write "<br />" & vbLf
- fsinhalt.write "<span style='font-size:7.5pt;color:#ee6c14'>This email and any attached files may contain confidential and/or privileged informations. If you are not the intended recipient (or have received this email in error) please notify the sender immediately and destroy this email. Any unauthorised copying, disclosure or distribution of the material in this email is strictly forbidden.</span>" & vbLf
- fsinhalt.write "<br />" & vbLf
- fsinhalt.write "<SPAN style='FONT-FAMILY:""Webdings"";color:#009900;font-size:13pt'>P </SPAN><span style='FONT-FAMILY:""Arial"";color:#009900;font-size:7.5pt'><b>Before you print - think about the environment</b></span>" & vbLf
- fsinhalt.write "</span>" & vbLf
- fsinhalt.write "</body>" & vbLf
- fsinhalt.write "</html>"
- fsinhalt.Close
- 'Genarate TXT File
- fsDateiName = fsDateiPfad & "Signatur-" & AccName & ".txt"
- Set fsDatei = CreateObject("Scripting.FileSystemObject")
- fsDatei.CreateTextFile fsDateiName
- Set fsDatei = fsDatei.getfile(fsDateiName)
- Set fsinhalt = fsDatei.OpenAsTextStream(2, -2)
- fsinhalt.write "Mit freundlichen Grüßen / Best regards" & vbLf & vbLf
- fsinhalt.write strPreName & " " & strName & " " & strSurname & vbLf
- if strTitle <> "" then
- fsinhalt.write strTitle & " / " & strDepartment & vbLf & vbLf
- else
- fsinhalt.write strDepartment & vbLf & vbLf
- end if
- fsinhalt.write "______________________________" & vbLf & vbLf
- if strPhone <> "" then
- fsinhalt.write "Tel: " & strPhone & vbLf
- end if
- if strMobil <> "" then
- fsinhalt.write "Mobil: " & strMobil & vbLf
- end if
- if strFax <> "" then
- fsinhalt.write "Fax: " & strFax & vbLf
- end if
- fsinhalt.write "E-Mail: " & strMail & vbLf
- fsinhalt.write "Web: " & strHP & vbLf & vbLf
- fsinhalt.write "...." & vbLf
- fsinhalt.write strStreet & vbLf
- fsinhalt.write strZip & " " & strCity & vbLf & vbLf
- fsinhalt.write "USt-IdNr. / Tax ID No.: ..." & vbLf
- fsinhalt.write "..." & vbLf
- fsinhalt.write "..." & vbLf
- fsinhalt.write " " & vbLf
- fsinhalt.write "Rechtlicher Hinweis: Diese E-Mail enthält vertrauliche und / oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet.<br>Legal notice: This e-mail contains confidential and / or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden." & vbLf & vbLf
- fsinhalt.Close
- end function
und nun bitte bitte bitte eine lösung... ich verzweifle dran