Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-17-2014, 05:43 PM
TylerSD TylerSD is offline How to use e-mail templates so that box auto-adjusts based on length of e-mail Windows 7 64bit How to use e-mail templates so that box auto-adjusts based on length of e-mail Office 2010 64bit
Novice
How to use e-mail templates so that box auto-adjusts based on length of e-mail
 
Join Date: Oct 2014
Posts: 6
TylerSD is on a distinguished road
Default How to use e-mail templates so that box auto-adjusts based on length of e-mail

Hi,



I'm trying to create an e-mail template for the first time for my new business. It's pretty basic -- a white box over a grey background, with a header at the top of the box with my logo. I created it using Outlook shapes, and the logo is an image.

My current issue is that I need to manually adjust the white box for each e-mail depending how long the text of the e-mail is. How can I have it automatically adjust? Am I making the template incorrectly?

Secondly, how can I use the template without having to go through the many steps for each e-mail: Home, New Items, More Items, Choose Form, Look In (folder), and then Open. I imagine there must be a shorter way? Also, is there a way to have it so that the template is used by default when creating a new message?

Thanks so much!
Tyler
Reply With Quote
  #2  
Old 10-17-2014, 11:20 PM
gmayor's Avatar
gmayor gmayor is offline How to use e-mail templates so that box auto-adjusts based on length of e-mail Windows 7 64bit How to use e-mail templates so that box auto-adjusts based on length of e-mail Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,103
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Replace the white box with a white filled table cell (with or without a border).
Table cells (and frames) will adjust to the amount of text. Text boxes won't.

As for ease of access - create a macro to perform the steps e.g. as follows. Change the path and template name as appropriate and add the macro to a button on the QAT (Quick Access Toolbar). The process is virtually identical to that shown at http://www.gmayor.com/installing_macro.htm (albeit that link shows the process in Word).

Code:
Sub PersonalMessage()
Dim oItem As MailItem
Const strFolder As String = "D:\Word 2010 Templates\"
Const strFilename As String = "Example.oft"
    Set oItem = Application.CreateItemFromTemplate(strFolder & strFilename)
    oItem.BodyFormat = olFormatHTML
    oItem.Display
    Set oItem = Nothing
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 10-18-2014, 06:04 PM
TylerSD TylerSD is offline How to use e-mail templates so that box auto-adjusts based on length of e-mail Windows 7 64bit How to use e-mail templates so that box auto-adjusts based on length of e-mail Office 2010 64bit
Novice
How to use e-mail templates so that box auto-adjusts based on length of e-mail
 
Join Date: Oct 2014
Posts: 6
TylerSD is on a distinguished road
Default

Awesome! Thanks, Graham. Both things worked

Couple of related follow-up questions:

1) I have an image in my template that is essentially a signature / business card. It's a jpg file. When I insert it into the template and send, it looks good on both ends. But, when I open the template to use again, this image is larger (both height and width), which doesn't look good. Any idea why it's doing this and how to prevent it? I can replace it each time, but that's not ideal.

2) When I use your macro shortcut, it opens it from my initial account, not my second account which I prefer. Any way to have it open the template from a specific account? Otherwise, I have to remember to change the From field each time. I'd prefer to not change the default account in general, though.

Thanks!
Tyler
Reply With Quote
  #4  
Old 10-18-2014, 09:42 PM
gmayor's Avatar
gmayor gmayor is offline How to use e-mail templates so that box auto-adjusts based on length of e-mail Windows 7 64bit How to use e-mail templates so that box auto-adjusts based on length of e-mail Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,103
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

I am not sure about the graphic. Have you tried creating the signature as a signature and apply that signature to the account you want to use? The following macro version will use the named account (shown here as "account name"

Code:
Sub PersonalMessage()
Dim oItem As Outlook.MailItem
Dim oAccount As Outlook.Account
Const strAcc As String = "account name"
Const strFolder As String = "D:\Word 2010 Templates\"
Const strFilename As String = "Example.oft"
    For Each oAccount In Application.Session.Accounts
        If oAccount.DisplayName = strAcc Then
            Set oItem = Application.CreateItemFromTemplate(strFolder & strFilename)
            oItem.BodyFormat = olFormatHTML
            oItem.SendUsingAccount = oAccount
            oItem.Display
        End If
    Next oAccount
    Set oItem = Nothing
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #5  
Old 10-20-2014, 11:35 AM
TylerSD TylerSD is offline How to use e-mail templates so that box auto-adjusts based on length of e-mail Windows 7 64bit How to use e-mail templates so that box auto-adjusts based on length of e-mail Office 2010 64bit
Novice
How to use e-mail templates so that box auto-adjusts based on length of e-mail
 
Join Date: Oct 2014
Posts: 6
TylerSD is on a distinguished road
Default

Graham,

I updated the macro with your new code, replacing "account name" with my account, and now the macro doesn't work. Nothing happens. I doublechecked the code, and even tried my other account name, but still nothing happens.

Is there a chance there is an error in this code? Is there something else I could be doing wrong? (note: I am new to macros)

Thanks.
Reply With Quote
  #6  
Old 10-20-2014, 10:47 PM
gmayor's Avatar
gmayor gmayor is offline How to use e-mail templates so that box auto-adjusts based on length of e-mail Windows 7 64bit How to use e-mail templates so that box auto-adjusts based on length of e-mail Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,103
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The account name is the name that is displayed in File > Account settings > E-Mail. The spelling must be EXACTLY as shown there.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #7  
Old 10-22-2014, 11:10 AM
TylerSD TylerSD is offline How to use e-mail templates so that box auto-adjusts based on length of e-mail Windows 7 64bit How to use e-mail templates so that box auto-adjusts based on length of e-mail Office 2010 64bit
Novice
How to use e-mail templates so that box auto-adjusts based on length of e-mail
 
Join Date: Oct 2014
Posts: 6
TylerSD is on a distinguished road
Default

I've tried both of my account names, and still nothing happens with your new account name code.

Any other thoughts?
Reply With Quote
  #8  
Old 10-22-2014, 09:57 PM
gmayor's Avatar
gmayor gmayor is offline How to use e-mail templates so that box auto-adjusts based on length of e-mail Windows 7 64bit How to use e-mail templates so that box auto-adjusts based on length of e-mail Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,103
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Run the following macro. Is the account shown

Code:
Sub Test()
Dim oAccount As Outlook.Account
    For Each oAccount In Application.Session.Accounts
        MsgBox oAccount
    Next oAccount
End Sub
If so I can not immediately see a reason why it should not work
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #9  
Old 10-23-2014, 03:51 PM
TylerSD TylerSD is offline How to use e-mail templates so that box auto-adjusts based on length of e-mail Windows 7 64bit How to use e-mail templates so that box auto-adjusts based on length of e-mail Office 2010 64bit
Novice
How to use e-mail templates so that box auto-adjusts based on length of e-mail
 
Join Date: Oct 2014
Posts: 6
TylerSD is on a distinguished road
Default

Nothing happens when I run that macro.
Reply With Quote
  #10  
Old 10-23-2014, 09:53 PM
gmayor's Avatar
gmayor gmayor is offline How to use e-mail templates so that box auto-adjusts based on length of e-mail Windows 7 64bit How to use e-mail templates so that box auto-adjusts based on length of e-mail Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,103
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

That would explain why the other macro didn't work, but it doesn't explain why this one doesn't. It should list all the available accounts.

I regret I have no further suggestions.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use e-mail templates so that box auto-adjusts based on length of e-mail VBA to automatically sort items based on Mail Merge field taylorblu Word VBA 3 09-08-2014 09:52 AM
How to use e-mail templates so that box auto-adjusts based on length of e-mail Templates, pictures, Mail Merge and Excel kckay Word VBA 1 05-17-2012 08:51 PM
How to use e-mail templates so that box auto-adjusts based on length of e-mail Automatically split Mail Merge based on number of pages SaneMan Mail Merge 1 12-03-2011 01:11 AM
dynamic charts based on mail merge fields jwajehee Mail Merge 0 10-05-2011 09:47 AM
Auto printing of new Mail DHeggen Outlook 1 02-14-2006 04:24 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:56 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft