Outlook Gurus, I have a question

Thread Tools
 
Search this Thread
 
Old May 15, 2006 | 12:03 PM
  #1  
KSUWildcat's Avatar
Thread Starter
|
Senior Member
Joined: Jun 2005
Posts: 258
Likes: 0
From: Pratt, KS
Outlook Gurus, I have a question

I send out an email every Monday with an attachment that I update weekly. I have figured out by now to compose a message template that contains the same recipients, subject line, and body of the message. Is there a way to have the template automatically update the attachment? Outlook help is useless.

What I want to do is update the attachment on my desktop, open the message template, and send it off.

TIA
 
Reply
Old May 15, 2006 | 12:09 PM
  #2  
UrbanCowboy's Avatar
Senior Member
Joined: Mar 2000
Posts: 481
Likes: 0
From: Westminster, CO
I dont think you can do that without deleting the old attachment and adding a new one.

I just tried myself and attempted a couple ideas; no luck.
 
Reply
Old May 15, 2006 | 12:26 PM
  #3  
vader716's Avatar
Senior Member
Joined: Jan 2003
Posts: 2,079
Likes: 0
From: Pikesville, MD
Something like this should work:


Sub Test()
Dim objMail As Outlook.MailItem

Set objMail = Application.CreateItem(olMailItem)
With objMail
.To = "Test" 'Insert a name to be sent to
.Body = "My Text" ' The mail body
.Display 'Show it
.OutlookAttach = .Attachments.Add("C:\test.txt")


End With


End Sub
 
Reply
Old May 15, 2006 | 12:30 PM
  #4  
UrbanCowboy's Avatar
Senior Member
Joined: Mar 2000
Posts: 481
Likes: 0
From: Westminster, CO
Oh sure; if you want to use VB.
 
Reply
Old May 15, 2006 | 12:38 PM
  #5  
KSUWildcat's Avatar
Thread Starter
|
Senior Member
Joined: Jun 2005
Posts: 258
Likes: 0
From: Pratt, KS
Originally Posted by vader716
Something like this should work:


Sub Test()
Dim objMail As Outlook.MailItem

Set objMail = Application.CreateItem(olMailItem)
With objMail
.To = "Test" 'Insert a name to be sent to
.Body = "My Text" ' The mail body
.Display 'Show it
.OutlookAttach = .Attachments.Add("C:\test.txt")


End With


End Sub
So your saying it looks like I'm better off deleting and attaching the old fashioned way. Had I a little more time to invest in Visual Basic, this would be the answer!

Thanks though!
 
Reply
Old May 15, 2006 | 12:38 PM
  #6  
vader716's Avatar
Senior Member
Joined: Jan 2003
Posts: 2,079
Likes: 0
From: Pikesville, MD
yea well....works dont it?

(actually I didnt debug it but it did create the message with the file for me)
 
Reply
Old May 15, 2006 | 12:42 PM
  #7  
UrbanCowboy's Avatar
Senior Member
Joined: Mar 2000
Posts: 481
Likes: 0
From: Westminster, CO
That's pretty sweet Vader. I write Macros for Excel all the time; have never thought of doing them in Outlook.
 
Reply

Trending Topics

Old May 15, 2006 | 12:42 PM
  #8  
vader716's Avatar
Senior Member
Joined: Jan 2003
Posts: 2,079
Likes: 0
From: Pikesville, MD
Originally Posted by KSUWildcat
So your saying it looks like I'm better off deleting and attaching the old fashioned way. Had I a little more time to invest in Visual Basic, this would be the answer!

Thanks though!
actually when you go into Outlook and macros...you should be able to code it yourself...you shouldnt need a full copy of VB
 
Reply
Old May 15, 2006 | 12:44 PM
  #9  
UrbanCowboy's Avatar
Senior Member
Joined: Mar 2000
Posts: 481
Likes: 0
From: Westminster, CO
Originally Posted by KSUWildcat
So your saying it looks like I'm better off deleting and attaching the old fashioned way. Had I a little more time to invest in Visual Basic, this would be the answer!
Originally Posted by vader716
actually when you go into Outlook and macros...you should be able to code it yourself...you shouldnt need a full copy of VB
He said Time Vader not Money.
 
Reply
Old May 15, 2006 | 12:55 PM
  #10  
vader716's Avatar
Senior Member
Joined: Jan 2003
Posts: 2,079
Likes: 0
From: Pikesville, MD
Originally Posted by UrbanCowboy
He said Time Vader not Money.
ok so I cant read.....

whats the big deal.....reading isnt that important anyways....



See I'm faking it over a cup of coffee
 
Reply
Old May 15, 2006 | 01:06 PM
  #11  
KSUWildcat's Avatar
Thread Starter
|
Senior Member
Joined: Jun 2005
Posts: 258
Likes: 0
From: Pratt, KS
Actually looking at it a little more over lunch here, this isn't so bad.
Are you getting a 438 error regarding the attachment code? And why doesn't it generate a message everytime I run the macro?

Now how do I add my signature? Can I make a shortcut on my desktop to run this macro?
 
Reply
Old May 15, 2006 | 01:14 PM
  #12  
vader716's Avatar
Senior Member
Joined: Jan 2003
Posts: 2,079
Likes: 0
From: Pikesville, MD
Sub Test()
Dim objMail As Outlook.MailItem

Set objMail = Application.CreateItem(olMailItem)
With objMail
'messageclass would load a form called test
.MessageClass = ("ipm.note.test")
.To = "Test" 'Insert a name to be sent to
.Body = "My Text" & vbCr & vbCr & "Thank you," & vbCr & "Signature goes here" ' The mail body
.Attachments.Add ("C:\test.txt")
.Display 'Show it



End With

Try this

You can add a button by right clicking the toolbar, customize, macros, select the macro and drag it to the bar
 

Last edited by vader716; May 15, 2006 at 01:22 PM.
Reply
Old May 15, 2006 | 01:18 PM
  #13  
KSUWildcat's Avatar
Thread Starter
|
Senior Member
Joined: Jun 2005
Posts: 258
Likes: 0
From: Pratt, KS
Can I do the signature with an HTML signature?
 
Reply
Old May 15, 2006 | 01:30 PM
  #14  
vader716's Avatar
Senior Member
Joined: Jan 2003
Posts: 2,079
Likes: 0
From: Pikesville, MD
Sub Test()
Dim objMail As Outlook.MailItem

Set objMail = Application.CreateItem(olMailItem)
With objMail
'messageclass would load a form called test
.MessageClass = ("ipm.note.test")
.To = "Test" 'Insert a name to be sent to
.Attachments.Add ("C:\test.txt")
.HTMLBody = "<html><font color = #00B2EE body text='#00B2EE'> <b>text: <font color = #b90000><i><b>" & "</b></i></font><br>Comment: <font color = #00B2EE><i><b>" & "</b></i></font> <p>Thanks </body></html>"
.Display 'Show it


End With


End Sub
 

Last edited by vader716; May 15, 2006 at 01:37 PM.
Reply
Old May 15, 2006 | 01:32 PM
  #15  
KSUWildcat's Avatar
Thread Starter
|
Senior Member
Joined: Jun 2005
Posts: 258
Likes: 0
From: Pratt, KS
Oh Snap!

Thanks Vader, I have a very limited scope of programming.

add: I can't get both the HTML and "plain text" body to show at the same time.
nm, I got it.
 

Last edited by KSUWildcat; May 15, 2006 at 01:47 PM.
Reply




All times are GMT -4. The time now is 06:16 PM.