home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 10,457 of 10,840   
   Ralph to Geoff   
   Re: VB6 and mailmerge   
   21 Mar 07 07:39:27   
   
   From: nt_consulting64@yahoo.com   
      
   "Geoff"  wrote in message   
   news:loSdnXDLLf59o53bnZ2dnUVZ8sGvnZ2d@brightview.com...   
   > Really not too sure what I am doing.  I would like to launch MS Word from   
   > VB6 so that it will mail- merge with a comma delimited text file  called   
   > Data.txt.  The code below launches MS Word but how to invoke the merge   
   from   
   > VB .. don't know   
   >   
   >   
   >   
   > Many thanks Geoff   
   >   
   >   
   >   
   >   
   >   
   > Private Sub Command1_Click()   
   >   
   >   
   >   
   > On Error GoTo Err_merge_Click   
   >   
   >   
   >   
   >   
   > 'Load the mail merge document as an object   
   >   
   > Dim objWord As Object   
   >   
   >    Set objWord = GetObject("E:\Word\VB\Merge.doc")   
   >   
   >   
   > 'Make Word visible   
   >   
   >    objWord.Application.Visible = True   
   >   
   >   
   >   
   > Exit Sub   
   >   
   >   
   >   
   > Err_merge_Click:   
   >   
   > MsgBox Err.Description   
   >   
   >   
   >   
   > End Sub   
   >   
   >   
      
   "How to automate Word with Visual Basic to create a Mail Merge"   
   http://support.microsoft.com/kb/285332   
      
   You might find these articles useful...   
   http://msdn2.microsoft.com/en-us/library/aa140183(office.10).aspx   
   http://msdn2.microsoft.com/en-us/library/aa140197(office.10).aspx   
      
   -ralph   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca