1) Yes , I would like date to be placed wherever the cursor is when I click
a toolbar button.
Problem is that still can no write code myself, so I dont know what
components should be added to this line
Selection.InsertBefore Format(Now, "ww, dd-MM-yyyy")
I can insert code into Module and can create the button on a toolbar.
2) As to first way you mentioned (place data at the *beginning* of every
document created from a particular template) -this not work, I tried
already. Most definitely, this code is incomplete, something incorrect:
Private Sub Document_New()
Selection.InsertBefore Format(Now, "ww, dd-MM-yyyy")
End Sub
I was just wondering if anybody could mail me complete code, for both
solutions.
Thanks,
breeze
"Jay Freedman" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
> If you want this date to be placed at the beginning of every document
> created from a particular template, then yes, put the Document_New macro
in
> the ThisDocument module of that template.
>
> If instead you want the date to be placed wherever the cursor is when you
> click a toolbar button, then you must name the macro something else (not
one
> of the special Document_ names, and not any of the Auto macro names like
> AutoNew, and not the name of any built-in Word command) -- for example,
name
> it Public Sub WeekAndDate(). Also note that it must be Public, not
Private,
> and place it in a regular module created by clicking Insert > Module in
the
> VBA editor. After the macro is saved in the template, you can create the
> button on a toolbar by using the procedure at
> http://word.mvps.org/FAQs/Customization/AsgnCmdOrMacroToToolbar.htm.
>
> --
> Regards,
> Jay Freedman
> Microsoft Word MVP FAQ: http://word.mvps.org
>
> breeze wrote:
> > Hi Jay,
> >
> > Where this macros should be placed exactly - in ThisDocument
> > >Document_New() event ?
> >
> >
> > Private Sub Document_New()
> >
> > Selection.InsertBefore Format(Now, "ww, dd-MM-yyyy")
> >
> > End Sub
> >
> > How to run macro from document toolbar?
> >
> > Thanks
> >
> > "Jay Freedman" < XXXX@XXXXX.COM > wrote in message
> > news: XXXX@XXXXX.COM ...
> >> Hi breeze,
> >>
> >> The line
> >> Selection.InsertBefore Format(Now, "ww, dd-MM-yyyy")
> >> will insert the string at the current cursor position. If you want it
> >> somewhere else, you'll have to tell us what that location is.
> >>
> >> --
> >> Regards,
> >> Jay Freedman
> >> Microsoft Word MVP FAQ: http://word.mvps.org
> >>
> >> breeze wrote:
> >>> I need automatically insert current date into specific Word docs(not
> >>> for all) with the following format: 'ww, dd-mm-yyyy', where 'ww' is
> >>> current week from the beginning of year(now is 30). MS Word 2000
> >>> have no such date format in Insert > Date and Time >Available
> >>> Formats.
> >>>
> >>> Could someone help with right and convenient solution?(detail code
> >>> and description)
>
>