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 / March 2004

Tip: Looking for answers? Try searching our database.

Import from Excel to Word Form, Save Individually

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
D - 12 Mar 2004 05:32 GMT
Hey guys-
New to this forum, seems like a TON of great info here. I'm gonna post this
to a couple different groups, so I apologize in advance. I just don't know
the proper place for it...

I have a psuedo database in Excel, and a Word form (all 2002/XP). I need to
export from Excel to the Word form- each row in Excel represents a new
individual form (the cells and fields are already linked up). Then, each
form (or row in Excel) will of coarse be saved as a separate word doc. How
do I go about doing this? Obviously, I'd like it to be some sort of Macro to
where the saving is quick and easy.
Thanks!
D
Doug Robbins - Word MVP - DELETE UPPERCASE CHARACTERS FROM EMAIL ADDRESS - 12 Mar 2004 05:38 GMT
Set up your form as a mailmerge main document with the Excel File as the
datasource. execute the merge to a new document and then with that document
active, run the following macro:

Sub splitter()

' splitter Macro

' Macro created by Doug Robbins to save each letter created by a mailmerge
as a separate file.

Dim Letters As Integer, Counter As Integer
Letters = ActiveDocument.Sections.Count
Selection.HomeKey Unit:=wdStory
Counter = 1
While Counter < Letters
   DocName = "Myletter" & LTrim$(Str$(Counter))
   ActiveDocument.Sections.First.Range.Cut
   Documents.Add
   Selection.Paste
   ActiveDocument.Sections(2).PageSetup.SectionStart = wdSectionContinuous
   ActiveDocument.SaveAs FileName:=DocName, FileFormat:= _
       wdFormatDocument, LockComments:=False, Password:="",
AddToRecentFiles:= _
       True, WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:= _
       False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
       SaveAsAOCELetter:=False
   ActiveWindow.Close
   Counter = Counter + 1
Wend

End Sub

Signature

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested.  Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps

> Hey guys-
> New to this forum, seems like a TON of great info here. I'm gonna post
[quoted text clipped - 12 lines]
> Thanks!
> D
D - 12 Mar 2004 06:05 GMT
Doug-
You rock dude. Im not sure how to create a macro, but, I'm gonna try to
figure this out. Is it possible to save each document filename using data
from 2 separate form fields?  ie- Address and last name from the fields in
each document will combine to save the document as  123 Main St -
Johnson.doc

Thanks for any and all handholding you can!  This is awesome, thank you!!!
D

> Set up your form as a mailmerge main document with the Excel File as the
> datasource. execute the merge to a new document and then with that document
[quoted text clipped - 46 lines]
> > Thanks!
> > D
Graham Mayor - 12 Mar 2004 07:18 GMT
Answered in your other post - please do not duplicate posts.

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
    Graham Mayor -  Word MVP

     Web site www.gmayor.com
 Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>

> Hey guys-
> New to this forum, seems like a TON of great info here. I'm gonna
[quoted text clipped - 10 lines]
> Thanks!
> D
 
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.