Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-13-2017, 11:18 AM
teza2k06 teza2k06 is offline Outlook macro Windows 7 64bit Outlook macro Office 2010 32bit
Advanced Beginner
Outlook macro
 
Join Date: Feb 2013
Posts: 37
teza2k06 is on a distinguished road
Default Outlook macro


Hi All,
I have found some basic macro coding online so that when i click a button on my ribbon it will open up the e-mail template
Code:
Sub email()
Set msg = Application.CreateItemFromTemplate("C:\Users\trb19\Desktop\test email.oft")
msg.Display
End Sub
The above code works with no problems.

However i have used the same coding (below) so that it opens a similar email, but with an attachment that will be sent in the e-mail. I have added this macro to the ribbon, but when i click on this button nothing happens

Code:
Sub InterviewPaperwork()
Set msg = Application.CreateItemFromTemplate("C:\Users\trb19\Desktop\interview record.oft")
msg.Display
End Sub
I am new to this, so it might just be a little error that i have done, but could anyone help me out so that it will open the email template with attachment??

Many thanks
Reply With Quote
  #2  
Old 07-13-2017, 08:13 PM
gmayor's Avatar
gmayor gmayor is offline Outlook macro Windows 10 Outlook macro Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,105
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

Is the template 'interview record.oft' on your desktop?
If you click the template icon on the desktop does the message open?
__________________
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 07-14-2017, 12:30 AM
teza2k06 teza2k06 is offline Outlook macro Windows 10 Outlook macro Office 2010 32bit
Advanced Beginner
Outlook macro
 
Join Date: Feb 2013
Posts: 37
teza2k06 is on a distinguished road
Default

If i open the template from the desktop then yes it will open. But when i try to open it from my toolbar within outlook then nothing opens.

If i open up visual basic and run the code, it does work and opens up the e-mail, just does not seem to work when i click the button under my toolbar

Last edited by teza2k06; 07-14-2017 at 12:46 PM.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Macro code for Outlook gbaker Outlook 0 04-11-2013 10:29 AM
Outlook macro CSV data to Outlook macro gbaker Excel Programming 3 03-28-2013 09:17 PM
Need help on Outlook 2010 Macro rainpuppy Outlook 4 02-04-2013 12:44 AM
Macro help outlook 2010 seanchad Outlook 0 06-28-2012 02:49 AM
Enable/Disable Macro in Outlook JimDandy Misc 0 05-11-2006 06:17 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:15 AM.


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