Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / December 2005

Tip: Looking for answers? Try searching our database.

merge from Access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BurtArkin - 21 Dec 2005 19:57 GMT
OS is XPPro, Access2002 and Word2002.  Access has msword.olb library
registered.  Is it possible for my access code to find a file, rename it and
save it, locate the source, and then not format the word document?  A sample
of the formatting code is below.  I'd really appreciate some help here.  
Thanks.

WApp.Selection.Find.ClearFormatting
Dim rngDocument As Object
''Find each instance of BLD and make entire paragraph bold, then delete "BLD"
Set rngDocument = WApp.ActiveDocument.Range
With rngDocument.Find
 .ClearFormatting
 .Replacement.ClearFormatting
 .Text = "BLD"
 .Forward = True
 .Wrap = 0 'wdFindStop
 .Format = False
 .MatchCase = True
 .MatchWholeWord = False
 .MatchWildcards = False
 .MatchSoundsLike = False
 .MatchAllWordForms = False
 .Execute
 While .Found
   rngDocument.Paragraphs.First.Range.Font.Bold = True
   rngDocument.Paragraphs.Alignment = wdAlignParagraphCenter  'my addition
for centering
   rngDocument.Delete
   rngDocument.MoveEnd 6 'wdStory
   .Execute
 Wend
End With
Signature

Burt

Cindy M  -WordMVP- - 25 Dec 2005 08:51 GMT
Hi =?Utf-8?B?QnVydEFya2lu?=,

> OS is XPPro, Access2002 and Word2002.  Access has msword.olb library
> registered.  Is it possible for my access code to find a file, rename it and
> save it, locate the source, and then not format the word document?

I'm not sure I understand the question (did you mistype the part about "not
format the word document"?)...

But in general terms, yes. It's not clear what you mean by "find a file", but
this sounds like you want some of the basic file management you can do in
Windows Explorer? In Office VBA, you can either use the old commands, like Dir
and Name to manipulate files. Or you can use FileSystemObject (FSO) that's part
of the Microsoft Scripting Runtime library (Tools/References).

Or are you talking about OPENING a document and using FILE/SAVE AS to give it
another name?

What do you mean by "locate the source", specifically?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
BurtArkin - 25 Dec 2005 19:04 GMT
Thanks for replying, and Happy Holidays.
The code I'm using, in Access, is supposed to locate a file (template),
merge data into it, then save it with a new name, and then perform some
formatting functions on the new Word doc.  The code works on my client's
system (using Office 2003) and worked on my old machine (before it crashed)
using Office 2002.  The installation on my new computer is using my
original--wait a minute!!!  There's an upgrade-SP3-for Office.  
I tested it and what was inexplicable is now as clear as a bell!!  Thanks to
your response, I was led to an epiphany of sorts which solved my problem.  
Yes, Cindy, there IS a Santa Claus.  I am a very happy and rieved camper
today.

Signature

Burt

> Hi =?Utf-8?B?QnVydEFya2lu?=,
>
[quoted text clipped - 23 lines]
> This reply is posted in the Newsgroup; please post any follow question or reply
> in the newsgroup and not by e-mail :-)
Cindy M  -WordMVP- - 27 Dec 2005 10:08 GMT
Hi Burt

> wait a minute!!!  There's an upgrade-SP3-for Office.  
> I tested it and what was inexplicable is now as clear as a bell!!  Thanks to
> your response, I was led to an epiphany of sorts which solved my problem.  
> Yes, Cindy, there IS a Santa Claus.

Yes, you see my pointy ears :-) Glad to have made your holidays happier.

   Cindy Meister
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.