Word 97: Displaying Previous month with fields??? 
Author Message
 Word 97: Displaying Previous month with fields???

Hi, I'm working on a project at work and I need to make Word 97
automatically display the previous month from the current date in a
document.  The format I'm using is the full month followed by the full year
( i.e. September, 2000)  I've been trying to use Fields to do this but I
cant get anything to work.  I found a piece of code on MSDN that supposedly


expected" error.  Does anybody have any idea how to do this?  Thanks!



Sat, 08 Mar 2003 03:00:00 GMT  
 Word 97: Displaying Previous month with fields???
Hi Tyler,

Do you really have to use fields, or could you solve the problem with a
macro? That's a little piece of code that can be run when creating a
new document or be linked to a button on a toolbar.

Like this:

Sub month_before()
Dim data As Date
data = DateAdd("m", -1, Now)
Selection.TypeText Format(data, "mmmm")
End Sub

This will print the name of the preceding month at the position of the
cursor.

Richard (NL)



Quote:

> Hi, I'm working on a project at work and I need to make Word 97
> automatically display the previous month from the current date in a
> document.  The format I'm using is the full month followed by the
full year
> ( i.e. September, 2000)  I've been trying to use Fields to do this
but I
> cant get anything to work.  I found a piece of code on MSDN that
supposedly

M} = 1

> expected" error.  Does anybody have any idea how to do this?  Thanks!

--
Foar de kofje net eamelje!
+---++---++-**-++---++---+

Sent via Deja.com http://www.deja.com/
Before you buy.



Sat, 08 Mar 2003 03:00:00 GMT  
 Word 97: Displaying Previous month with fields???

I don't get that error (Word 97 SR2) with the codes shown.  I *do* get it

and that error goes away if I put the 8/1/92 in double quotes.  So, that
may be relevant, and you might try quoting the whole IF field, or the IF
field plus the /1/92, or the two *outcomes* in the IF field (the 12 and
then everything from the following curly brace through 92).  Something
like that's gotta work.

Quote:

> Hi, I'm working on a project at work and I need to make Word 97
> automatically display the previous month from the current date in a
> document.  The format I'm using is the full month followed by the full year
> ( i.e. September, 2000)  I've been trying to use Fields to do this but I
> cant get anything to work.  I found a piece of code on MSDN that supposedly


> expected" error.  Does anybody have any idea how to do this?  Thanks!



Sat, 08 Mar 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Word 97: Displaying Previous month with fields???

2. Word 97: Displaying Previous month with fields???

3. Word 97: Automatically Making the Previous Month Appear???

4. Field to display previous month

5. Error in my code - inputing in a word 97 field

6. decimal point - strange behaviour macro Word 97 and previous vers ion

7. display under Word 97 & Word 2000

8. Display a field from a previous record...

9. Word 97 : To display full file path at top

10. Word 97 template cannot display userform

11. Display an Access 97 ole field in VB5

12. Display an Access 97 ole field in VB5

 

 
Powered by phpBB® Forum Software