Re: Need to load and print a merged document from VB




"Keith" <Keith@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5951DB74-D14C-4F6C-9E2E-AFDBEE1890BC@xxxxxxxxxxxxxxxx
> Hi,
>
> I have set up a mail merge document in MS Word I'll call MyTemplate.doc I
> run Mail Merge to merge with a text file called MyData.txt.
>
> I'm using VB to generate a new MyData.txt file. Has anyone ever written
> code that will load MyTemplate.doc, instruct MyTemplate to mail merge into
> a
> new document, then print the new document and exit the new document and
> MyTemplate without saving?
>
> Also, I may have to set some of the printer settings before I print it.
>
> Now can you do this with 3 or fewer lines of code? (just kidding).


I can't say that I've personally done what you're needing. I can tell you it
will almost definately take more than 3 lines of code. Although, if there's
a way to do it in 3 lines or less, Rick Rothstein is the guy who will know.
He's the king of the one-liners. <g>.

The best newsgroup for you to get help with this is actually one of the
MSWord (or Office) newsgroups because you'll need to use Word Automation.
Try one or more of the following (be sure to crosspost, not multipost, if
posting to more than one newsgroup):

microsoft.public.word.mail
microsoft.public.word.mailmerge.fields
microsoft.public.word.vba.general
microsoft.public.office.developer.vba


--
Mike
Microsoft MVP Visual Basic



.



Relevant Pages

  • Re: Need to Load a Doc, Mail Merge and Print from VB6
    ... > code that will load MyTemplate.doc, instruct MyTemplate to mail merge into a ... that will give you the basic syntax. ... If you need help refining it, please tell us the version of Word involved and ... This reply is posted in the Newsgroup; please post any follow question or reply ...
    (microsoft.public.office.developer.vba)
  • Re: NO, MICROSOFT DOES NOT SEND OUT SECURITY PATCHES, IT IS A VIRUS!
    ... in a newsgroup the flood of posts asking questions that could ... > this would become a useless resource for those truly needing more advanced ... >> It's everyone's first time, ...
    (microsoft.public.security)
  • Re: Text Driver jailed for 4 years
    ... needing to kill anyone! ... motorway traffic jam, it is a more serious offence ... Email address maintained for newsgroup use only, ...
    (uk.rec.driving)
  • Re: VB6+ Article in VSM by Bill McCarthy
    ... Post replies to the newsgroup. ... "Rick Rothstein" wrote in message ... |> Classic Visual Basic hacks into .NET is not my idea of a solution. ... this is the root problem of all these kind of discussions. ...
    (microsoft.public.vb.general.discussion)
  • Re: easy .net. is a class and componet sysnonymous
    ... what do you mean by volunterr? ... Is that what the v in mvp is for? ... "Rick Rothstein" wrote: ... That way, no matter what newsgroup I'm in, I'll see other people's ...
    (microsoft.public.vb.general.discussion)

Loading