Link to home
Create AccountLog in
Avatar of Jegajothy vythilingam
Jegajothy vythilingamFlag for United States of America

asked on

outlook 2007

When creating a new email in outlook, how do I set the left and right margins.  Can I run a macro, if Yes, can u please give me the code and also how to install and run it. Thanks.
Avatar of greenhacks
Flag of India image

I just wrote same macro for that few day ago.
Let me post link to it.

Has instrustions as well just above excepted answer.
Read how it works.
In Outlook Goto Tools, Macro, VBEditor, Expand Project1, Click ThisOutlookSession, On Right side paste the code, save and close.
Again Goto Tools,Macro, Security, Set level to Medium or Warning.
Restart Outlook, it will ask to trust macro, then please click yes.
And thats it.

New Email ORReply to some email, and reply or type things normally. This time it will not show marging.
But when you click send.
This macro will add a margin to outgoing email be it a new email or reply or forward.
So you do not need to use template as well.

You can see the effect in your sent items :)
It will set 100px margin, if you need more or less, modify the code and chaneg values for left and right margin.

Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Item.HTMLBody = "<div style=""margin-left:100px;margin-right:100px;"">" & Item.HTMLBody & "</div>"
End Sub

Open in new window

Avatar of Jegajothy vythilingam


I am more used to characters or in inches.  how would I code the equivalent. thanks.
How many characters you want?
Avatar of greenhacks
Flag of India image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
an excellent solution!