Prev: Remove/hide General folder
Next: Borderless form
From: Graham Mayor on 27 Jan 2010 02:29 See http://www.gmayor.com/insert_a_date_other_than_today.htm and in particular the link to http://www.gmayor.com/downloads.htm#Third_party -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org <>>< ><<> ><<> <>>< ><<> <>>< <>><<> "redtwotwo" <bills.lazar(a)gmail.com> wrote in message news:d3a8c75e-acb2-4579-bbc2-cd6bc24cbf9d(a)l11g2000yqb.googlegroups.com... Hi. I am trying something similar as this but I would like to create a sheet of labels which has the date + 15 days. How would you suggest implementing this? There are many labels per page, do I have to create many different variables and allow the vba to set each one or is there an easier way? I have used vba in excel but this is my first venture for word. I would be grateful for help in this area. Thanks Heather On Jan 20, 2:44 am, "Doug Robbins - Word MVP" <d...(a)REMOVECAPSmvps.org> wrote: > Thanks, Karl. Good to know. > > -- > Hope this helps. > > Please reply to the newsgroup unless you wish to avail yourself of my > services on a paid consulting basis. > > Doug Robbins - Word MVP, originally posted via msnews.microsoft.com > > "Karl E. Peterson" <k...(a)exmvps.org> wrote in > messagenews:eNHu#cWmKHA.2680(a)TK2MSFTNGP04.phx.gbl... > > > Doug Robbins - Word MVP explained on 1/15/2010 : > >>> would like it to be the current time + 6 hours. > > >> Format(DateAdd("h", 6, Now), "h:mm am/pm") > > > Not that there's anything wrong with that approach. It's probably the > > most readable answer there is. Just wanted to kick in another method, > > for > > sake of having all options out there. > > > Background: Date variables are really Doubles in drag. The day is stored > > in the whole portion, and the time in the fractional part. > > > So, to add 6 hours, one need only add a quarter of a day: > > > Format(Now + 0.25, "h:mm am/pm") > > > Might be useful, for more calculation intensive operations... > > > -- > > .NET: It's About Trust! > >http://vfred.mvps.org
From: Doug Robbins - Word MVP on 30 Jan 2010 01:13
In the Labels dialog in word, having selected the type of label that you are using and with the selection in the Address area of the dialog, Press Ctrl+F9 to insert a pair of field delimiters { } and inside them type { DOCVARIABLE varDate } The select the Full page of the same label radio button and then click on New Document. Then with that document as the active document, run a macro containing the following code With ActiveDocument .Variables("varDate").Value = Format(DateAdd("d", 15, Now), "dd mmmm yyyy" ) .Range.Fields.Update End With -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "redtwotwo" <bills.lazar(a)gmail.com> wrote in message news:d3a8c75e-acb2-4579-bbc2-cd6bc24cbf9d(a)l11g2000yqb.googlegroups.com... > Hi. I am trying something similar as this but I would like to create a > sheet of labels which has the date + 15 days. How would you suggest > implementing this? There are many labels per page, do I have to create > many different variables and allow the vba to set each one or is there > an easier way? > > I have used vba in excel but this is my first venture for word. I > would be grateful for help in this area. > > Thanks > Heather > > On Jan 20, 2:44 am, "Doug Robbins - Word MVP" > <d...(a)REMOVECAPSmvps.org> wrote: >> Thanks, Karl. Good to know. >> >> -- >> Hope this helps. >> >> Please reply to the newsgroup unless you wish to avail yourself of my >> services on a paid consulting basis. >> >> Doug Robbins - Word MVP, originally posted via msnews.microsoft.com >> >> "Karl E. Peterson" <k...(a)exmvps.org> wrote in >> messagenews:eNHu#cWmKHA.2680(a)TK2MSFTNGP04.phx.gbl... >> >> > Doug Robbins - Word MVP explained on 1/15/2010 : >> >>> would like it to be the current time + 6 hours. >> >> >> Format(DateAdd("h", 6, Now), "h:mm am/pm") >> >> > Not that there's anything wrong with that approach. It's probably the >> > most readable answer there is. Just wanted to kick in another method, >> > for >> > sake of having all options out there. >> >> > Background: Date variables are really Doubles in drag. The day is >> > stored >> > in the whole portion, and the time in the fractional part. >> >> > So, to add 6 hours, one need only add a quarter of a day: >> >> > Format(Now + 0.25, "h:mm am/pm") >> >> > Might be useful, for more calculation intensive operations... >> >> > -- >> > .NET: It's About Trust! >> >http://vfred.mvps.org > |