Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-06-2017, 01:45 AM
Mike Henderson Mike Henderson is offline Save Form Data as Delimited text via VBA Windows 7 64bit Save Form Data as Delimited text via VBA Office 2007
Novice
Save Form Data as Delimited text via VBA
 
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 offline Save Form Data as Delimited text via VBA Windows 7 64bit Save Form Data as Delimited text via VBA Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

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
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 10-06-2017, 04:09 AM
gmayor's Avatar
gmayor gmayor is offline Save Form Data as Delimited text via VBA Windows 10 Save Form Data as Delimited text via VBA Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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



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
Save Form Data as Delimited text via VBA 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

Other Forums: Access Forums

All times are GMT -7. The time now is 11: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