Auteur de questions
déplacer image sous visual studio 2010 sur Add IN Outlook

Question
-
Bonjour,
Je souhaite créer un ruban sous outlook 2007 (sous Visual studio 2010) comprenant des mails types enregistrés au format html relié a des boutons.
Le problème c'est que l' image comprise dans le mail ne s'affiche pas. Par conséquent je la charge directment dans le mail mais je ne parviens pas à la déplacer. En effet elle reste bloquée en haut a gauche.
voici mon code :
Private Sub Button20_Click(ByVal sender As System.Object, ByVal e As Microsoft.Office.Tools.Ribbon.RibbonControlEventArgs) Handles Button20.Click Dim oMail As Outlook.MailItem Dim objMsg As Outlook.MailItem, objReply As Outlook.MailItem Dim objRecips As Outlook.Recipients, objRecip As Outlook.Recipient Dim intX As Integer Dim stext As String Dim oFSO Dim oFS If Globals.ThisAddIn.Application.ActiveExplorer.Selection.Count Then If TypeOf Globals.ThisAddIn.Application.ActiveExplorer.Selection(1) Is Outlook.MailItem Then oMail = Globals.ThisAddIn.Application.ActiveExplorer.Selection(1).replyAll oFSO = CreateObject("Scripting.FileSystemObject") oFS = oFSO.OpenTextFile("D:\Documents\mike\Desktop\test 2.htm") oMail.Attachments.Add("D:\Documents\mike\Desktop\logo.jpg") stext = oFS.ReadAll oMail.BodyFormat = Outlook.OlBodyFormat.olFormatHTML oMail.HTMLBody ="<img src='logo.jpg'/>" stext & vbCr & oMail.HTMLBody oMail.Display() End If If Globals.ThisAddIn.Application.ActiveInspector Is Nothing Then Exit Sub objMsg = Globals.ThisAddIn.Application.ActiveInspector.CurrentItem objReply = objMsg objRecips = objReply.Recipients For intX = objRecips.Count To 1 Step -1 objRecip = objRecips.Item(intX) If objRecip.Name = "SceClients@gmail.com" & "Service Client" Then objRecip.Delete() End If Next objReply.Display() objMsg = Nothing objReply = Nothing objRecip = Nothing objRecips = Nothing On Error GoTo 0 Exit Sub RemoveID_Error: MsgBox("Error " & Err.Number & " (" & Err.Description & ") in procedure ") Resume Next End If End Sub
Est il possible de décaler l'image vers la droite ?
Cordialement
Toutes les réponses
-
-
bonjour et merci pour votre retour,
Je ne sais pas pourquoi mais cela ne fonctionnait pas avec votre code. J'ai donc utilisé ceci :
<center><img src='logo.jpg'></center> & vbCrLf & stext & oMail.HTMLBody
L'image est centré, mais est il possible d'appliquer une marge au texte pour qu'il soit aligner à l'image ? ou bien appliquer une marge sur le mail afin que l'image et le texte soit bien aligné ?
cordialement
-