Question

Locked

using VB to generate word letters from txt files

By alan.bailey ·
My IT guys have provided me with a txt file that has 'protected' the first character of each line to tell the word doc whether to skip a line (or two or more) and when to break to a new page. The only trick is i don't know how to set up a Macro to generate the letters. can anyone pint me int he direction of a dummies guide as my IT wiz is now on leave.

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Is this an XML file?

by DelbertPGH In reply to using VB to generate word ...

I'm guessing that your text file contains XML markup tags. Maybe it's something else, though, like for mailing lists and form letters.

In Word online help I looked up "importing xml files" and got a bunch of hits. Here are instructions from one of them:
1. Place the insertion point where you want to insert the data.
2. On the Insert menu, click Field, and in the Field names box, click IncludeText.
3. In the Filename or URL box, type the name of the file, including its system path or URL.
4. Select the Namespace mappings check box, and type a namespace in the format xmlns:variable="namespace". For example, xmlns:a="resume-schema".
5. If you want to insert only a fragment of data rather than the whole file, select the XPath expression check box, and then type the XPath (XML Path Language (XPath): A language used to address parts of an XML document. XPath also provides basic facilities for manipulation of strings, numbers, and Booleans.) expression in the box provided. For example, a:Resume/a:Name specifies the Name element in the root element Resume.
6. If you want to use an Extensible Stylesheet Language Transformation (XSLT) (XSL Transformation (XSLT): A file that is used to transform XML documents into other types of documents, such as HTML or XML. It is designed for use as part of XSL.) to format the data, select the XSL Transformation check box, and type the name of the file, including its system path or URL.
7. Click OK.

Good luck.

Back to Software Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums