Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-05-2022, 06:29 AM
ianpg56 ianpg56 is offline Formatting custom data type in mail merge. Windows 10 Formatting custom data type in mail merge. Office 2021
Novice
Formatting custom data type in mail merge.
 
Join Date: Mar 2022
Posts: 2
ianpg56 is on a distinguished road
Default Formatting custom data type in mail merge.


I have a merge field in a tab delimited csv file that is of the format ["element 1", "element2"] from 0 to 12 elements.

The csv file produced by a custom application (written in Swift on Mac) could be modified but not easy.

The mail merge needs to display the elements of the filed one per line but only if the field exists.

The merge document uses the csv file as its data source and the merge will ideally be triggered from the Mac application, possibly via a script but thats just a nice to have.

I believe that this can be done by the built in VB, worked out how to get the value from the merge fields but no idea how to get the result from the function into the merge output. Assuming I need a field of some kind but thats were even my ability to google fails to find a clue.

I have not used VB since version 3 too many moons ago to even remember!

Not even sure I am going about this the right way. Client will be upgrading to Office 365 if I can get this too work as Pages on the Mac is . . . .

Any suggestions / ideas much apricated.

Ian
Reply With Quote
  #2  
Old 03-05-2022, 03:03 PM
macropod's Avatar
macropod macropod is offline Formatting custom data type in mail merge. Windows 10 Formatting custom data type in mail merge. Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

There is nothing in your post that indicates what the custom data types might be or what formatting is required.

For the conditional line output, see Mailmerge Empty Line Suppression in the Mailmerge Tips & Tricks 'Sticky' thread at the top of this forum: https://www.msofficeforums.com/mail-...ps-tricks.html

No VBA needed for this.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 03-06-2022, 06:05 AM
ianpg56 ianpg56 is offline Formatting custom data type in mail merge. Windows 10 Formatting custom data type in mail merge. Office 2021
Novice
Formatting custom data type in mail merge.
 
Join Date: Mar 2022
Posts: 2
ianpg56 is on a distinguished road
Default

I have a merge field in a tab delimited csv file that is of the format ["element 1", "element2"] from 0 to 12 elements.

What other information is required?

An example of the field in the csv would be <field separator tab>["element 1", "element2"]<field separator tab>

The VB function takes that data and format it into a multi line string but I now need to call that function and display that result in the merged document.
Reply With Quote
  #4  
Old 03-06-2022, 03:14 PM
macropod's Avatar
macropod macropod is offline Formatting custom data type in mail merge. Windows 10 Formatting custom data type in mail merge. Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by ianpg56 View Post
I have a merge field in a tab delimited csv file that is of the format ["element 1", "element2"] from 0 to 12 elements
CSV files have Comma-Separated Values. A tab-delimited file is not a CSV file, no matter what extension you give it.
Quote:
Originally Posted by ianpg56 View Post
An example of the field in the csv would be <field separator tab>["element 1", "element2"]<field separator tab>
Evidently, then, you data are coming from some other system. You should get whoever produces the data to output in a format that is suitable for mailmerge. Alternatively, pre-process that data so it's suitable for mailmerge. That would require all 12 elements to be catered for in each record, even if empty.

Your ["element 1", "element2"], etc. do not constitute custom data types - in a tab-delimited file they are a single piece of data and, with the double-quotes, are liable to mess up a mailmerge.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting custom data type in mail merge. Is there a way to do a mail merge type of addition of data after a mail merge has been done? mtandino Word 4 06-01-2021 02:00 PM
Formatting custom data type in mail merge. Mail merge type fields in publisher TerryTunesmith Publisher 1 02-12-2020 08:14 PM
Formatting custom data type in mail merge. Mail Merge type is not being retained as ‘letter’ when document copied from one location to another milnor Mail Merge 4 01-30-2019 01:37 PM
Formatting custom data type in mail merge. Mail Merge Document Type craigj Mail Merge 2 10-03-2016 08:39 PM
Formatting custom data type in mail merge. Custom Mail Merge luke Mail Merge 1 04-09-2013 03:10 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:18 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft