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 / Word / Programming / September 2006

Tip: Looking for answers? Try searching our database.

go to & highlight today's date on open

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
adgorn - 29 Sep 2006 21:26 GMT
I have a word document with a lengthy list of dates in a table.  Upon
opening, I'd like to see today's date highlighted and have it go to that
date.  Help??!!  Thanks!  
Signature

Alan

Helmut Weber - 30 Sep 2006 08:51 GMT
Hi,

in what format are the dates,
and more,
is that format used *consistently* ?

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

adgorn - 30 Sep 2006 15:30 GMT
They are consistent.  Here's an example:

29-Sep-06

Signature

Alan

> Hi,
>
> in what format are the dates,
> and more,
> is that format used *consistently* ?
Helmut Weber - 30 Sep 2006 19:08 GMT
Hi Alan,

like this:

Sub autoopen()
Dim sTmp As String
Dim rDcm As Range
Set rDcm = ActiveDocument.Range
sTmp = Format(Date, "DD-MMM-YY")
With rDcm.Find
  .Text = sTmp
  If .Execute Then
     rDcm.HighlightColorIndex = wdYellow
     rDcm.Select
     selection.Collapse
  else
     Msgbox "date of today not found"
  End If
End With
End Sub

Insert a module in the project
with the name of your doc.
Insert the code in that module.

HTH

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

adgorn - 30 Sep 2006 20:07 GMT
It worked perfectly!

Danke für Deine Hilfe!

Signature

Alan

> Hi Alan,
>
[quoted text clipped - 22 lines]
>
> HTH

Rate this thread:






 
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.