Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-01-2011, 04:39 PM
nore nore is offline Macros Windows 7 32bit Macros Office 2003
Novice
Macros
 
Join Date: Jun 2011
Posts: 1
nore is on a distinguished road
Default Macros

Greetings

So I am creating a new email message and I want to append a certain string to the subject (eg. date in ddmmyyyyhhmm format). How can that be done?

I'm trying that in VB (unless there is another way), but I couldn't find a method to get a reference of the current new email message. This will allow me to run the macro which results in appending the required string.

Any help is appreciated.
e.g.

'this is just bad...
Sub DateTag()
'Dim MyMail As mailItem

Dim strID As String
Dim mailNS As Outlook.NameSpace


Dim mailItem As Outlook.mailItem

'strID = MyMail.EntryID

Set mailNS = Application.GetNamespace("MAPI")
Set mailItem = mailNS.GetItemFromID(strID)
mailItem.Subject = "date"
mailItem.Save

Set mailItem = Nothing
Set mailNS = Nothing
End Sub
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macros vbTab in macros ElfegoBaca Word VBA 1 05-26-2011 09:40 PM
Macros Steveg Word VBA 0 08-18-2010 04:04 PM
Macros Macros Desertwrangler Word VBA 6 06-25-2010 07:06 AM
macros trancetheory Outlook 0 05-11-2010 09:31 AM
Macros Macros krdzal Excel 1 04-06-2010 07:43 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:37 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