Change value of Word MailMerge field using VBA

Utilizing DocVariables I do it making use of the complying with. This works so I understand I possess the best suggestion and also that the rest of my code works fine.

The factor is given that this document is actually to “merged” with one row of information so it is a rubbish of opportunity inquiring the consumer to perform the entire records resource trait for one row.

I possess an operating remedy making use of DocVariables which I am actually certain lots of people will certainly state is the correct technique to perform it, nevertheless this customer ases if the tip of “seeing” the mailmerge variable (such as) in the resource document. They know they can easily utilize Alt-F9 to present codes to see the DocVariables, but they emphasize wanting to utilize MergeFields.

Having said that, I may not workout session just how to carry out the same point with merge industries. I wish to carry out something like the beneath (yet there is actually no “market value” home to establish).

Or is actually each industry’s colour linked to a different column in the information resource? And also are you trying to colour the entire cell, or even just the result text message? And do you have a little (how big?), limited lot of achievable colours? Trouble is, a few of these probabilities perhaps need to have code to resolve all of them

I possess a word document I am actually utilizing as a mail merge attached to an Excel spreadsheet. In words document are a collection of tables, each tissue filled by several industries from the Excel spread sheet. There are actually 3 grounds that are actually meant to turn red when the combine ground=’Reddish’, green when it is actually ‘Environment-friendly’, and the like. The concern is, conditional format won’t function in Word, so I need to find out some way to format these cells without it.

I had a Word Document that I wished to have DocVariable areas that I could customize coming from Accessibility through VBA. I very desired to “see” the mail merge areas. If I developed the document along with DocVariable industries to start along with (e.g.,, Insert >> Quick Parts >> Industry and also the insert a DocVariable field), they were either unnoticeable or even presented the whole long field code. Thus suppose I have actually industries called FNAME and DONATION in a character giving thanks to an individual for their gift as the document.

I have a document with MailMerge industries, having said that I do certainly not desire to utilize the whole datasource- > mailmerge idea. As an alternative I am actually showing a UserForm on Autonew() and also asking the user to type the records right into the areas.

Develop the document with mail combine areas. You may must make a fake Excel report or database to connect to if you want to add the industries. After doing this, you’ll “view” the mail merge industries in the document (e.g., “FNAME”).

Note that you can actually only put one mail combine industry as well as then copy/paste it, changing the name for various areas. There have to be something hidden in the mail combine field that acquires replicated when you do this that doesn’t exist if you merely place a DocVariable field, yet I have not been able to determine what it is actually. So this is actually undoubtedly a workaround, yet it worked with me. It gives you the most effective of each worlds, “seeing” the mail combine area but coming to use it like a DocVariable industry coming from VBA.

Any concepts on exactly how I can programmatically change the market value of a mail combine area without using a datasource.

I was anticipating some kind of service that would certainly use the word-merge’s If-Then-Else regulation, yet I don’t presume that’s feasible. Any aid is considerably enjoyed.

Leave a Reply

Your email address will not be published. Required fields are marked *