Re: Word 2003 Macros and VBA Question

Subject: Re: Word 2003 Macros and VBA Question
From: "Edgar D' Souza" <edgar -dot- b -dot- dsouza -at- gmail -dot- com>
To: "Karen Murri" <kmurri -at- comcast -dot- net>
Date: Sat, 23 Dec 2006 11:43:55 +0530

On 12/22/06, Karen Murri <kmurri -at- comcast -dot- net> wrote:

change it a bit. Instead of opening new docs based on the Normal template,
I'd like to base it on a custom template. And, I'd like to pull the document
name from some of the merged information (maybe point it to a style?).

From the Word 2000 VBA help file:
====================
Add Method (Documents Collection)
Adds a new, empty document to the collection of open documents.
Syntax
expression.Add(Template, NewTemplate, DocumentType, Visible)

expression Required. An expression that returns a Documents object.

Template Optional Variant. The name of the template to be used for
the new document. If this argument is omitted, the Normal template is
used.
====================

Pulling the document name to save a chunk of content as, from the
merged doc - that would depend on the code you're using to grab the
chunks from your merged doc. If (for example) the first paragraph in
every chunk was the document name, and was formatted with a special
paragraph style, hidden text, then you would have two ways of getting
at it:
Selection.Range.Paragraphs(1).Range.Text would be one way, IIRC;
"Selection" here represents the selected text - the chunk which you're
about to rip out into a new doc. Or you could simply loop through all
the paragraphs in the Selection, looking for paragraphs formatted with
your Ninja style:
Dim para As Word.Paragraph
Dim strFileName As String

For Each para In Selection.Range.Paragraphs
If para.Style = "MyNinjaStyle" Then
strFileName = para.Range.Text
End If
Next

HTH
Ed.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

WebWorks ePublisher Pro for Word features support for every major Help format plus PDF, HTML and more. Flexible, precise, and efficient content delivery. Try it today! http://www.webworks.com/techwr-l

Create HTML or Microsoft Word content and convert to Help file formats or printed documentation. Features include single source authoring, team authoring,
Web-based technology, and PDF output. http://www.DocToHelp.com/TechwrlList

---
You are currently subscribed to TECHWR-L as archive -at- infoinfocus -dot- com -dot-
To unsubscribe send a blank email to techwr-l-unsubscribe -at- lists -dot- techwr-l -dot- com
or visit http://lists.techwr-l.com/mailman/options/techwr-l/archive%40infoinfocus.com


To subscribe, send a blank email to techwr-l-join -at- lists -dot- techwr-l -dot- com

Send administrative questions to admin -at- techwr-l -dot- com -dot- Visit
http://www.techwr-l.com/techwhirl/ for more resources and info.


References:
Word 2003 Macros and VBA Question: From: Karen Murri

Previous by Author: Re: Thinking like a user, or sticking to tried and true?
Next by Author: Re: free or open-source tools
Previous by Thread: Re: Word 2003 Macros and VBA Question
Next by Thread: escalation on approvals (using Documentum)


What this post helpful? Share it with friends and colleagues:


Sponsored Ads