Avatar of Mawallace
Mawallace
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Start a MACRO If statement true - Word

I have a macro in a Word document.

How do I start a macro if a merge filed is a certain value?
Microsoft Word

Avatar of undefined
Last Comment
GrahamSkan

8/22/2022 - Mon
GrahamSkan

Sorry Mark,

That isn't possible. You would have to run the merge from VBA, a record at a time, and check the field value before or after the merge for that record and call the macro according to the particular datafield value.

What do you want to do in the macro that would be called? There may be another way to achieve the objective.
Mawallace

ASKER
I would like to delete a section of text if the merge field is true. If the merge field is not true, I do not want the section removed.
SOLUTION
GrahamSkan

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Mawallace

ASKER
What is it is is two or three paragraphs, with formatting such as tables?
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Mawallace

ASKER
Yes - that is right!
GrahamSkan

Hi Mark,

Are we to take it that the penny has dropped, and that you have a full understanding of the method?

Graham
Mawallace

ASKER
No - I was trying to make it clearer!

I have  I two or three paragraphs, with formatting such as tables which need including. I would assume this would make the suggested solution of including within an If statement more complicated?
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Mawallace

ASKER
How do I enter a Quote 34 field?
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.