Avatar of Jegajothy vythilingam
Jegajothy vythilingam
Flag 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.
Outlook

Avatar of undefined
Last Comment
Jegajothy vythilingam

8/22/2022 - Mon
greenhacks

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

https://www.experts-exchange.com/questions/24780115/Microsoft-Outlook-2007.html

Has instrustions as well just above excepted answer.
Read how it works.
greenhacks

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

This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Jegajothy vythilingam

ASKER
I am more used to characters or in inches.  how would I code the equivalent. thanks.
greenhacks

How many characters you want?
ASKER CERTIFIED SOLUTION
greenhacks

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Jegajothy vythilingam

ASKER
an excellent solution!
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.