Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails
Public Sub PrintMMDoc_MS_Word(ByVal strMMDataDir As String, ByVal strMMDataFile As String, ByVal strMMDocDir As String, ByVal strMMDDocFile As String) '2007-06-03 Ted Palmer 'Dim wrdApp As Word.Application: Instantiated in class frmLogin >> cmdLogin_Click event. 'Closed & Disposed in class MainMDIFrame >> Closing event go_wrdApp.Visible = True '2007-05-24 Ted Palmer 'This Try-Catch block uses MailMerge functionality of "Word.Application" to print an instance 'of the MS-word document passed as a parameter to this subroutine and 'the MailMerge data file passed as a parameter to this subroutine. Try 'Open an existing MailMerge Main document. Dim wrdDoc As Object go_wrdApp.ChangeFileOpenDirectory(strMMDocDir) wrdDoc = go_wrdApp.Documents.Open(FileName:=strMMDDocFile) '<-- MS-Word MailMergeMain document wrdDoc.MailMerge.MainDocumentType = 0 wrdDoc.MailMerge.OpenDataSource(Name:= _ strMMDataDir & strMMDataFile, ConfirmConversions:=False, _ ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _ PasswordDocument:="", PasswordTemplate:="", WritePasswordDocument:="", _ WritePasswordTemplate:="", Revert:=False, Format:=0, _ Connection:="", SQLStatement:="", SQLStatement1:="", SubType:=0) With wrdDoc.MailMerge .Destination = 0 .SuppressBlankLines = True With .DataSource .FirstRecord = 1 .LastRecord = -16 End With .Execute(Pause:=False) End With Catch ex As Exception MessageBox.Show("In Module MainModule >> Sub PrintMMDoc, there was an Error in the MailMerge process. " _ & "YOU the user probably caused this exception by closing the Microsoft Word application frame. " _ & "Please don't do this again. You probably did this during the Print Preview process. During that process. " _ & "you must close the MS-Word document and the MS-Word MailMerge Main document, but not the application frame. " _ & "When closing the MailMerge Main document, you will see 2 small x(s) in the upper right corner of the application " _ & "frame. Click ONLY the bottom x. Then minimize the application frame. To recover from this condition " _ & "and restore the printing subsystem, you must exit the AutoSubrogate(TM) program and restart it again. " _ & "Please save your work and restart the AutoSubrogate(TM) program now: " & ex.Message, _ "AutoSubrogate(TM) Exception:", MessageBoxButtons.OK, MessageBoxIcon.Stop) End Try End Sub 'PrintMMDoc_MS_Word
|HOW D I CLEAR PICTURES IN IMAGE CONTROL AND COMMENTS IN CELLS WHEN WORKBOOK IS OPENED||18||48|
|C# DataGridView_RowsAdded event not firing||1||38|
|Help with sending PDF contents to server when Hyperlink Clicked.||5||11|
|In C#, how would you convert a byte array to its integer value equivalent?||12||12|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
18 Experts available now in Live!