With ActiveDocument
.Variables("exptime").Value = Format(DateAdd("h", 6, Now), "h:mm am/pm")
.Range.Fields.Update
.PrintOut
End With
You must use Ctrl+F9 to insert the field delimiters around the docvariable
field and use Alt+F9 to toggle off their display
--
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
"roursler" <rour...@discussions.microsoft.com> wrote in message
news:77CA2157-36DE-4769...@microsoft.com...
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
--
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" <ka...@exmvps.org> wrote in message
news:eNHu#cWmKH...@TK2MSFTNGP04.phx.gbl...
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...@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...@exmvps.org> wrote in messagenews:eNHu#cWmKH...@TK2MSFTNGP04.phx.gbl...
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
"redtwotwo" <bills...@gmail.com> wrote in message
news:d3a8c75e-acb2-4579...@l11g2000yqb.googlegroups.com...
{ 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...@gmail.com> wrote in message
news:d3a8c75e-acb2-4579...@l11g2000yqb.googlegroups.com...