Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-09-2015, 03:57 AM
gmaxey gmaxey is offline VBA to save word user form value to xml Windows 7 32bit VBA to save word user form value to xml Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Rose,
I'm pressed for time today, but one option would be to use mapped content controls to store your metadata. Mapped CCs are bound to a data node in a customXMLPart that become part of the document. It is an easy step to then save the data as a text file:

Sub ScratchMacro()
Dim fso As Object
'A basic Word macro coded by Greg Maxey
'MsgBox ActiveDocument.CustomXMLParts(4).XML
Set fso = CreateObject("Scripting.FileSystemObject")
Dim oFile As Object
Set oFile = fso.CreateTextFile("C:\New File")
oFile.WriteLine ActiveDocument.CustomXMLParts(1).XML
oFile.Close
Set fso = Nothing
Set oFile = Nothing
lbl_Exit:


Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
User Form - Close Paragraphs SonyaEnz Word VBA 4 06-05-2015 06:16 AM
User form abdulgani Excel 0 12-15-2014 05:54 AM
how to save contents in textbox in VB2013 form into a Word document? saltlakebuffalo Word VBA 6 12-10-2014 06:12 PM
VBA to save word user form value to xml Force User to Save As lgillespie Word 6 09-09-2013 03:13 PM
VBA to save word user form value to xml User Form placasse47 Excel Programming 3 08-01-2012 05:57 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:13 AM.


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