Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Word VBA

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 07-12-2018, 10:52 AM
Drakos Drakos is offline Windows 7 64bit Office 2016
Novice
 
Join Date: Jul 2018
Posts: 4
Drakos is on a distinguished road
Default Having trouble with Truncation

I am producing an executive level status report using data downloaded from a TABLEAU report into an .CSV file. I cannot use a Mail Merge because it won't allow me to do what I need to do for the report. The report format is as follows:



Summary page(s) containing a brief summary for each record in the .CSV file. Then after the summary page(s) there is a full page status report for each record in the .CSV file.

Although I cannot use Mail Merge I am using the MailMergeDataSource to open the .CSV file. I am using VBA to iterate through the data source and produce the report, everything is working fine except one thing, any of my data Fields that are longer the 255 characters are being truncated to 255 characters.

I find this strange because everything comes out fine if I use the same data source for an actual Mail Merge. I've done alot of searching on the internet for a solution but none of the suggestions are fixing the issue.
Reply With Quote
  #2  
Old 07-12-2018, 07:46 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 910
Guessed is on a distinguished road
Default

Do you get the same result if you open the csv with Excel, save that file in Excel format and then point the mail merge at Excel data instead?
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 07-12-2018, 08:41 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 18,603
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Quote:
Originally Posted by Drakos View Post
I am using VBA to iterate through the data source and produce the report, everything is working fine except one thing, any of my data Fields that are longer the 255 characters are being truncated to 255 characters.

I find this strange because everything comes out fine if I use the same data source for an actual Mail Merge.
That suggests your process is treating those fields as text fields, whereas they need to be treated as memo fields.

That said, without seeing either the data source or the intended output, it's impossible to confirm your assessment that mailmerge can't be used.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #4  
Old 07-20-2018, 09:55 PM
Drakos Drakos is offline Windows 7 64bit Office 2016
Novice
 
Join Date: Jul 2018
Posts: 4
Drakos is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
Do you get the same result if you open the csv with Excel, save that file in Excel format and then point the mail merge at Excel data instead?
Thank you for the suggestion but I've tried saving it as an excel file and the data still gets truncated. When I view the records in Excel the data is all there.
Reply With Quote
  #5  
Old 07-21-2018, 11:35 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 18,603
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

In that case, you can either:
• re-arrange the data so the first few records have more than 255 characters in the fields concerned; or
• insert a dummy first record that has more than 255 characters in the fields concerned.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #6  
Old 07-27-2018, 09:59 PM
Drakos Drakos is offline Windows 7 64bit Office 2016
Novice
 
Join Date: Jul 2018
Posts: 4
Drakos is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
In that case, you can either:
re-arrange the data so the first few records have more than 255 characters in the fields concerned; or
insert a dummy first record that has more than 255 characters in the fields concerned.
Again, I appreciate the suggestion, but I have already tried this. I've tried multiple times including the "dummy" rows, as many as 10 rows didn't fixt the problem in a 30 row dataset.
Reply With Quote
  #7  
Old 07-27-2018, 10:19 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 18,603
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Is there a reason you can't use the actual datasource your CSV is produced from?
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #8  
Old 07-28-2018, 09:15 PM
Drakos Drakos is offline Windows 7 64bit Office 2016
Novice
 
Join Date: Jul 2018
Posts: 4
Drakos is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Is there a reason you can't use the actual datasource your CSV is produced from?
The data is downloaded from a Tableau report into the .CSV. I cannot directly access a Tableau report from Word and the report is report is generated using data from multiple data sources.
Reply With Quote
  #9  
Old 07-28-2018, 11:19 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 18,603
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

As I said before:
Quote:
without seeing either the data source or the intended output, it's impossible to confirm your assessment that mailmerge can't be used.
Likewise, without seeing either the data source or the VBA code you're using, it's impossible to know what the issue is on that front.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
trouble with code gummybear Excel 3 04-19-2018 12:26 PM
Trouble with me animations Halesowenmum PowerPoint 5 11-21-2017 04:14 AM
Trouble with Hyperlinks DanielMcCrea Word 1 09-27-2017 02:35 PM
I'm having trouble doing these tasks jackmackfack Word 4 02-19-2015 06:46 PM
Macro trouble Zack Excel 2 10-14-2010 12:07 PM


All times are GMT -7. The time now is 01:12 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft