Microsoft Word & Macros

Discussion in 'Bulletin Board ARCHIVE' started by Cazi, Sep 20, 2006.

  1. Caz

    Cazi New Member

    Joined:
    Jul 16, 2005
    Messages:
    13,133
    Likes Received:
    1
    Location:
    A completely different planet to everybody else
    Well hello you technical wizards, can anyone help me with this?

    I'll try to explain  as best I can.................I need a macro, or something similar, that will automatically put in the following days date into a merged document. I want to have todays date on the first page and then the automatic insertion of the following days date put on the next page.

    Is this possible and how?

    I've tried creating a macro which did work, kind of. However, I had to insert that macro every day. I want something that can remain untouched, so to speak.

    Any ideas?
     
  2. Gue

    Guest Guest

    You best not have bloody sorted it now...

    ...after all the effort I've made! :)

    Try inserting this into your macro VB code - it may need some modification to suit your purposes but, I think, it's fairly clear how it works...

    Dim d As Date
    d = Now() + 1
    Selection.TypeText Text:=(Day(d))
    Selection.TypeText Text:=("\")
    Selection.TypeText Text:=(Month(d))
    Selection.TypeText Text:=("\")
    Selection.TypeText Text:=(Year(d))

    It seemed to work OK when I tested it and (appears to) validate the new, incremented date automatically (that is it ensures the month and year rolls over when the final day is reached).
     
  3. Caz

    Cazi New Member

    Joined:
    Jul 16, 2005
    Messages:
    13,133
    Likes Received:
    1
    Location:
    A completely different planet to everybody else
    Thank you, I'll give it a whirl tomorrow

    Anyone else got any ideas?
     

Share This Page