Re: Insert text at end of journal entry

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Charles Kenyon (msnewsgroup_at_remove.no.spam.addbalance.com)
Date: 02/14/05


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.
>>
>>
>
>



Relevant Pages

  • Re: User Input into custom form
    ... teach yourself Outlook programming in 24 hours, or some title like that, by ... > behind the AutoFill Command Button that you suggested previously? ...
    (microsoft.public.outlook.program_forms)
  • Re: Automating emails
    ... In the past I would have jumped in and learned what I needed to accomplish ... I do some elementry programming in Access. ... there is a newsgroup specifically for general Outlook programming ... >> off to all the brokers. ...
    (microsoft.public.outlook.general)
  • Re: 2 attempt: Why is CreateItemFromTemplate so slow?
    ... Why are you not posting this in a group for Outlook programming? ... | Dim strBody As String ...
    (microsoft.public.outlook)
  • Uploading files...
    ... Erm, this must be an error SOMEWHERE - but I can't find it. ... I have been in programming a while but a pretty new to the PHP/C++ scene so ... It only works if I do it twice - it's like the save-name only works if I do ...
    (alt.php)
  • Re: Thou shalt have no other gods before the ANSI C standard
    ... Alan Balmer writes: ... > Incidentally, I've been programming for about twice as long as you, ... > and my code most likely was involved in producing the plastic your ...
    (sci.crypt)