Outlook EX UDF - Hyperlink auf einem Image
-
hevilp -
22. Januar 2017 um 17:49 -
Erledigt
-
-
Siehe meine Antwort im engl. Forum
-
Hi,
ich muss nochmal nach haken
Ich erstelle mit "_OL_MailSignatureCreate" eine Signatur.
Das ist alles wunderbar, auch ein Bild füge ich dort ein.Ist es auch möglich ein Hyperlink auf das Image zu legen?
Im normalen Word / Outlook ist das ja möglich, mit _OL_MailSignatureCreate auch? -
_OL_MailSignatureCreate legt ja nur aus dem Word-Range die Signatur für Outlook an. Den Inhalt erstelltst Du ja mit Word (siehe auch Beispiel-Skript). Mit Word lässt sich problemlos in Link auf ein Bild setzen. Sollte also auch für eine Signatur einfach möglich sein.
-
Danke, aber ich stehe auf dem Schlauch.
Mit _Word_DocPictureAdd oder InlineShapes.AddPicture("D:\image001.jpg")
bekomme ich das Bild rein, das klappt.Ich finde auch überhaupt keine Doku über die Word-Befehle, wo muss ich denn schauen?
-
Die einfachste Methode:
In Word den Makro Recorder aufdrehen, ein Bild einfügen und einen Link dazu, Makrorecorder stoppen und das erstellte VBA Skript nach AutoIt übersetzen. Geht ganz einfach. -
Spoiler anzeigen
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:= "http://www.test.de", SubAddress:=""
Wie ich das aber in den Syntax von AutoIt bekomme, weiß ich noch nicht...
-
Dann ist der Makro-Recorder zu doof.
Ich muss das testen sobald ich wieder im Büro bin. Sollte eine Kombination aus _Word_DocPictureAdd und _Word_DocLinkAdd sein. -
Code
$oRange = _Word_DocRangeSet($oDoc, -2) _Word_DocPictureAdd($oDoc, "D:\image001.jpg", Default, Default, $oRange) $oRange = _Word_DocRangeSet($oDoc, $oRange, Default, Default, Default, 1) _Word_DocLinkAdd($oDoc, $oRange, $scurrentLink)
Fügt am Ende ein Bild ein, und setzt den Link drauf. Funktioniert!
Vielen Dank
-