Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #12  
Old 06-09-2015, 12:03 AM
macropod's Avatar
macropod macropod is offline VBA to save word user form value to xml Windows 7 64bit VBA to save word user form value to xml Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

That is rather different from simply adding them to the document's properties, though having done so you will find the corresponding xml code inside the docx file. As I said in your other thread ():
Quote:
saving the data from a userform in an xml format requires you to supply all the relevant xml tags - whose attributes depend on what you're trying to do with the xml
How you would go about that depends on whether you already have some boilerplate xml code like:

<metadata>
<SystemInfo>Customer Info</SystemInfo>
<NumberOfRecords>2</NumberOfRecords>
<FileTransferHeader>
<ProcessingDate>20150531</ProcessingDate>
<ProcessingTime>205036</ProcessingTime>
<FileName>sample.docx</FileName>
</FileTransferHeader>
</metadata>

or:

<metadata>
<SystemInfo>Customer Info</SystemInfo>
<NumberOfRecords>2</NumberOfRecords>
<FileTransferHeader>
<ProcessingDate>20150531</ProcessingDate>
<ProcessingTime>205036</ProcessingTime>
<FileName>sample.docx</FileName>
</FileTransferHeader>
<RecordsInfo>
<Name></Name>
<Address></Address>
<Author></Author>
</RecordsInfo>
</metadata>

In the first example, you'd need to add all of:

<RecordsInfo>
<Name>Rose</Name>
<Address>20150531</Address>
<Author>Admin</Author>
</RecordsInfo>

to the file, perhaps replacing </metadata> as well. In the second example, you might just want to insert:
Rose
into:
<Name></Name>
and so on - or you might want to replace the entire:

<RecordsInfo>
<Name></Name>
<Address></Address>
<Author></Author>
</RecordsInfo>
</metadata>

block with:

<Name>Rose</Name>
<Address>20150531</Address>
<Author>Admin</Author>
</RecordsInfo>
</metadata>

So, you see, it's all a matter of deciding which approach works best for you. There are no hard & fast rules about this.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



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 09:40 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