Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Word VBA

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 10-06-2017, 01:45 AM
Mike Henderson Mike Henderson is offline Windows 7 64bit Office 2007
Novice
 
Join Date: Oct 2017
Posts: 1
Mike Henderson is on a distinguished road
Default Save Form Data as Delimited text via VBA

Hi

I'm trying to write some code to take some Word Forms and export them as text delimited text files. Manually I can do this, but I'd like to automate it through vba.

I can get the code to work to convert from .doc to .txt, but there is a couple of additional things I cant see how to do.

In the advanced options of word 2007 under Preserve Fidelity there is a tick box that I need to turn on for "Save form data as delimited text file". I'm struggling to find how to turn this on through vba.



Also, when the file is saved the csv file save dialog box has an option via a tick box called "Allow character substitution" at the point you choose the CSV format. I'm struggling to find this as well.

Any pointers towards documentation on these features would really be helpful if anyone can help?

Cheers

Mike
Reply With Quote
  #2  
Old 10-06-2017, 03:35 AM
macropod's Avatar
macropod macropod is online now Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 16,647
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 behold
Default

Is there a reason for not using the same Save method to save the form data instead of just saving the document as a text file?
Code:
With ActiveDocument
  .SaveAs2 FileName:=Split(.FullName, ".")(0) & "_Form.csv", _
    Fileformat:=wdFormatText, SaveFormsData:=True
End With
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 10-06-2017, 04:09 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 2,220
gmayor is a jewel in the roughgmayor is a jewel in the roughgmayor is a jewel in the roughgmayor is a jewel in the rough
Default

You might find http://www.gmayor.com/ExtractDataFromForms.htm useful.
__________________
Graham Mayor - MS MVP (Word)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2013 Forms (how to questions)- Quick opening of a form file & Linking form's data to Excel gamin2407 Outlook 0 01-21-2017 10:14 PM
Data Entry Form - Hide Click here to enter text. sunrise06 Word 4 05-07-2015 08:44 PM
designing a custom outlook form - this form is for only sending mails nt collect data balamuralibm Outlook 0 05-21-2014 08:08 AM
Save as delimited text dwillyfan Word 4 08-29-2012 09:58 AM
Is there a way to do this? (automatically enter text based on form data) TIKKI555 Word 0 05-26-2010 09:21 AM


All times are GMT -7. The time now is 10:44 PM.


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