Because hyperlinks are child objects of the Range object, we can’t insert a hyperlink without first having a Range object.
So what’s going on here? Well, we want paragraph 2 to be our hyperlink.
Outlook 2016 insert table into signature code#
Here’s the code that adds a hyperlink to our email signature: Set objRange = objDoc.Paragraphs(2).Range This is where it gets just a tiny bit tricky (but not much). (In other words, having typed in the user name, we now want to press ENTER and start a new paragraph.) In the first line, we’re using the TypeText method to type the user name (Ken Myer) into our document in line 2, we’re using the TypeParagraph method to replicate the ENTER key. What’s that? What is the meaning of life? Let’s put it this way: the Scripting Guys should be the last people you want answering a question like that.Īdding the user name to a signature block is easy that’s what these two lines of code are for: objSelection.TypeText "Ken Myer"Īs we implied, there’s nothing very complicated about this. Why? Who knows you might as well ask “What is the meaning of life?” Well, you’d think so, wouldn’t you? As it turns out, however, Outlook’s object model doesn’t include any options for creating new email signatures for some reason, however, Word’s object model does provide a way to create a new email signature. That also leads to an obvious question: if we’re trying to create a new signature for Microsoft Outlook, then why in the world are loading up Microsoft Word? Shouldn’t we be loading up Outlook instead? We kick things off in truly festive fashion, creating an instance of the Word.Application object and then setting the Visible property to True that gives us a running instance of Microsoft Word that we can see on screen. ObjSignatureEntries.Add "My Signature", objSelection Set objSignatureEntries = objSignatureObject.EmailSignatureEntries Set objSignatureObject = objEmailOptions.EmailSignature Set objEmailOptions = objWord.EmailOptions (objRange, " ",, , "Fabrikam Corporation") Set objRange = objDoc.Paragraphs(2).Range After all, we’re giving that script away, absolutely free: Set objWord = CreateObject("Word.Application") Well, to be perfectly blunt, if you said anything but “Nothing” then you got ripped off. On the other hand, what about a script – created by this very same Scripting Guy – that can not only build a new Outlook email signature, but include a hyperlink within that signature? How much would you be willing to pay for that? We suppose it’s possible that the autograph of the Scripting Guy who writes this column isn’t worth $5 million.
In fact, now that we think about it, she really has contributed as much to system administration and the Script Center as William Shakespeare has, hasn’t she? After all, if she’s not the William Shakespeare of system administration, well, we don’t know who is. Good point: maybe we should have asked them about the Scripting Editor’s autograph instead. Well, once they stopped laughing, that is. Five million dollars for the autograph of some playwright who’s been dead for almost 400 years?!? Holy smokes can you imagine how much this same Scripting Guy’s autograph must be worth?!?Īctually, that’s what the folks at Christie’s auction house said, too. And he can … most of the time, anyway.) This Scripting Guy didn’t pay much attention to that until just recently, when he learned that William Shakespeare’s autograph is worth an estimated $5 million. During his last two trips to TechEd Orlando, the Scripting Guy who writes the column has actually been asked for his autograph! (To be honest, we don’t know why, either, although he suspects people just wanted to see if he could spell his own name correctly. You know, it’s interesting that you mention signatures.
Outlook 2016 insert table into signature how to#
Hey, Scripting Guy! I’m trying to use a script to create a Microsoft Office Outlook signature, but I can’t figure out how to add a live hyperlink to that signature.