Computing.Net > Forums > Office Software > ms word: if, then, else usage

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

ms word: if, then, else usage

Reply to Message Icon

Name: operative28
Date: September 25, 2008 at 15:06:28 Pacific
OS: xp
CPU/Ram: Pentium ??, 10^10TB of RA
Product: MS word 2003
Comment:

I am trying to use an if then else to print out a year whose value is dependent on the if condition.

Specifically, if the current month is greater than July, I want to print out the current year plus 2 years. If the current month is less than July, I want to print out the current year plus 3 years.

A similar conditional that IS working is shown here:

{ IF MONTH(DATE) < 7 "JULY" "JANUARY" }

This prints out July or January depending on whether or not the current month is less than July (the 7th month).

So, the difference between this one and the one I need to make is that the output is not static, as the words "July" and "January" are. The then and else actions should actually call functions that return the current year (plus 2 or 3).

Any ideas??



Sponsored Link
Ads by Google

Response Number 1
Name: DerbyDad03
Date: September 25, 2008 at 19:30:59 Pacific
Reply:

What language is this code written in? It certainly doesn't look like VBA for MS Word, which is what most macros are written in.


0

Response Number 2
Name: jon_k
Date: September 26, 2008 at 08:39:18 Pacific
Reply:

it's the mail merge syntax, but I'm not sure how to get it working correctly. My cheating method would be to put it in the source Excel file as a formula, but I'd imagine you've tried that route already!


0

Response Number 3
Name: DerbyDad03
Date: September 26, 2008 at 09:55:32 Pacific
Reply:

Try this site. It contains an example that sounds similiar to yours.

http://www.addbalance.com/usersguid...

Navigate to the site and then use Ctrl F to search for current year

Directly above the example for Date Fields is a discussion on Nested If's. Perhaps between the 2 of those techniques you can come up with a solution.

Good luck.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: ms word: if, then, else usage

MS Word if...then else wildcards www.computing.net/answers/office/ms-word-ifthen-else-wildcards/8825.html

IF-Then, (else) (Jennifer SUMN) www.computing.net/answers/office/ifthen-else-jennifer-sumn/2953.html

Wildcards in VBA IF...THEN www.computing.net/answers/office/wildcards-in-vba-ifthen/2927.html