Re: Insert text at end of journal entry
From: Charles Kenyon (msnewsgroup_at_remove.no.spam.addbalance.com)
Date: 02/14/05
- Next message: Sue Mosher [MVP-Outlook]: "Re: Insert text at end of journal entry"
- Previous message: peppy: "RE: Selecting who should recieve and attachment in an email message"
- In reply to: Sue Mosher [MVP-Outlook]: "Re: Insert text at end of journal entry"
- Next in thread: Sue Mosher [MVP-Outlook]: "Re: Insert text at end of journal entry"
- Reply: Sue Mosher [MVP-Outlook]: "Re: Insert text at end of journal entry"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 14 Feb 2005 12:46:14 -0600
Thank you for the pointer. I inserted the following code and it works but
it flashes the following message (twice):
Message:
A program is trying to access e-mail addresses that you have stored in
Outlook. Do you want to allow this? ...
When I click to allow (twice) it runs and inserts what I want.
Code:
Sub CallBack()
' code adapted from http://www.outlookcode.com/d/code/stampdate.htm
' 14 February 2005
'
Dim objApp As Application
Dim objItem As Object
Dim objNS As NameSpace
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set objItem = objApp.ActiveInspector.CurrentItem
If objItem.Class = olJournal Then
objItem.Body = objItem.Body & vbCrLf _
& "Returned call at " & Now() _
& " - " & objNS.CurrentUser
End If
Set objItem = Nothing
Set objNS = Nothing
Set objApp = Nothing
End Sub
"Sue Mosher [MVP-Outlook]" <suemvp@outlookcode.com> wrote in message
news:ez8zJxqEFHA.3512@TK2MSFTNGP10.phx.gbl...
> Take a look at http://www.outlookcode.com/d/code/stampdate.htm .
>
> --
> Sue Mosher, Outlook MVP
> Author of
> Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
>
> "Charles Kenyon" <msnewsgroup@remove.no.spam.addbalance.com> wrote in
> message news:%23eQImjqEFHA.1936@TK2MSFTNGP14.phx.gbl...
>>I would like to insert the text at the end of a journal entry.
>>Specifically, I am trying to add, on a new line:
>>
>> Call returned at (date) (time) inserting the date and time.
>>
>> Which vba methods, objects and properties should I be using here?
>>
>> I am brand new to Outlook programming but have done quite a bit with Word
>> vba.
>>
>> TIA
>>
>> --
>>
>> Charles Kenyon
>>
>> Word New User FAQ & Web Directory: http://addbalance.com/word
>>
>> --------- --------- --------- --------- --------- ---------
>> This message is posted to a newsgroup. Please post replies
>> and questions to the newsgroup so that others can learn
>> from my ignorance and your wisdom.
>>
>>
>
>
- Next message: Sue Mosher [MVP-Outlook]: "Re: Insert text at end of journal entry"
- Previous message: peppy: "RE: Selecting who should recieve and attachment in an email message"
- In reply to: Sue Mosher [MVP-Outlook]: "Re: Insert text at end of journal entry"
- Next in thread: Sue Mosher [MVP-Outlook]: "Re: Insert text at end of journal entry"
- Reply: Sue Mosher [MVP-Outlook]: "Re: Insert text at end of journal entry"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|