Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Contacts / February 2007

Tip: Looking for answers? Try searching our database.

Automatically enter the date in the details field (Contacts)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
lion - 28 Jan 2007 19:28 GMT
I'm using Outlook 2003 as a CRM-program.
Every time I have contacted a client or a prospect, I write down the date
and a few words in the details field.
I want to be able to use a shortcut key to place the (system)date in the
details field automatically. Do I have to create a macro to do that and what
would it look like?
Thanks in advance for your answers.
Sue Mosher [MVP-Outlook] - 07 Feb 2007 14:54 GMT
Yes, that takes a macro. See http://www.outlookcode.com/d/code/stampdate.htm 

Signature

Sue Mosher, Outlook MVP
  Author of Configuring Microsoft Outlook 2003
    http://www.turtleflock.com/olconfig/index.htm
  and Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx
 

> I'm using Outlook 2003 as a CRM-program.
> Every time I have contacted a client or a prospect, I write down the date
[quoted text clipped - 3 lines]
> would it look like?
> Thanks in advance for your answers.
lion - 07 Feb 2007 17:41 GMT
Hi Sue,
Thank you so much for your answer. I already found the code and applied it
in my form. I changed it a little bit:
-------
Sub StampContact()
   Dim objItem As Object
   Dim objNS As NameSpace
   
   Set objNS = Application.GetNamespace("MAPI")
   Set objItem = Application.ActiveInspector.CurrentItem
   If objItem.Class = olContact Then
       objItem.Body = FormatDateTime(Now(), 2) & ":" & vbCrLf & vbCrLf &
vbCrLf & objItem.Body
   End If
   
   Set objItem = Nothing
   Set objNS = Nothing
End Sub
-------
The only question I have (at the moment) is:
when I execute this macro, it stamps the date, but the cursor is placed at
the beginning of the same line.
What do I have to add to place the cursor on the next line so I can start
typing my text right away?
Hope my question is clear to you.
(I bought your book Teach Yourself........ It's very good and I'm busy
learning the techniques).

> Yes, that takes a macro. See http://www.outlookcode.com/d/code/stampdate.htm 
>
[quoted text clipped - 5 lines]
> > would it look like?
> > Thanks in advance for your answers.
Sue Mosher [MVP-Outlook] - 07 Feb 2007 18:55 GMT
Look at the statement that actually inserts the text:

   objItem.Body = FormatDateTime(Now(), 2) & ":" & vbCrLf & vbCrLf & vbCrLf & objItem.Body

See what order it uses to concatenate the different text expressions? Now, change that order by rearranging the expressions.

> What do I have to add to place the cursor on the next line so I can start
> typing my text right away?

That's not possible without a third-party component or Outlook 2007.

Signature

Sue Mosher, Outlook MVP
  Author of Configuring Microsoft Outlook 2003
    http://www.turtleflock.com/olconfig/index.htm
  and Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx
 

> Hi Sue,
> Thank you so much for your answer. I already found the code and applied it
[quoted text clipped - 30 lines]
>> > would it look like?
>> > Thanks in advance for your answers.
lion - 08 Feb 2007 08:13 GMT
Maybe it's a bit silly, but I tryed to change the order of the concatenated
strings, but this didn't solve the problem.
In the example below the date is placed at the end of the text, but the
cursor jumps back to the top (which is even worse).

       objItem.Body = objItem.Body & FormatDateTime(Now(), 2) & ":" &
vbCrLf & vbCrLf & vbCrLf

There should be a statement in VBA to move the cursor down one line, isn't
there?

> Look at the statement that actually inserts the text:
>
[quoted text clipped - 41 lines]
> >> > would it look like?
> >> > Thanks in advance for your answers.
Sue Mosher [MVP-Outlook] - 08 Feb 2007 12:14 GMT
> There should be a statement in VBA to move the cursor down one line, isn't
> there?

See the response on this issue.in my earlier post.

Signature

Sue Mosher, Outlook MVP
  Author of Configuring Microsoft Outlook 2003
    http://www.turtleflock.com/olconfig/index.htm
  and Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx
 

> Maybe it's a bit silly, but I tryed to change the order of the concatenated
> strings, but this didn't solve the problem.
[quoted text clipped - 52 lines]
>> >> > would it look like?
>> >> > Thanks in advance for your answers.
lion - 08 Feb 2007 13:41 GMT
OK, thank you.

> > There should be a statement in VBA to move the cursor down one line, isn't
> > there?
[quoted text clipped - 57 lines]
> >> >> > would it look like?
> >> >> > Thanks in advance for your answers.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.