![]() |
|
![]() |
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
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 |
#2
|
||||
|
||||
![]()
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 |
#3
|
|||
|
|||
![]()
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 |
#4
|
||||
|
||||
![]()
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 |
#5
|
|||
|
|||
![]()
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. |
#6
|
||||
|
||||
![]()
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 |
#7
|
|||
|
|||
![]()
I've tried both of my account names, and still nothing happens with your new account name code.
![]() Any other thoughts? |
#8
|
||||
|
||||
![]()
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
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#9
|
|||
|
|||
![]()
Nothing happens when I run that macro.
|
#10
|
||||
|
||||
![]()
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 |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
taylorblu | Word VBA | 3 | 09-08-2014 09:52 AM |
![]() |
kckay | Word VBA | 1 | 05-17-2012 08:51 PM |
![]() |
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 |