Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Merge Word Files And Print To PDF Print


Looking for code would allow me to merge multible word files into a single file and print to a single pdf file.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Mail Merge VB Access To Word To Print Multiple Records Via Button
Hey guys.. I'm hoping someone can help me.. I've tried heaps of versions of code that are on the net for mail merges and this is the only one I could get working but I need it to print multiple records not just one by altering the code below.. I am currently trying to do a multiple record mail merge through a query via a command button on a form. The query basically displays customers who have said yes to privacy. The user inputs a date into txtDate on frmDate and the clicks "View Queried Privacy Records" Once they click this it opens the query form frmPrivacy which then has a command button cmdMailmerge to perform the mail merge and print the records that result from that query. (I would prefer to perform the query and mail merge/print without having to go frmPrivacy)

The command button has the following code:


Private Sub cmdMailmerge_Click()

On Error GoTo MergeButton_Err


'Start Microsoft Word
Dim objWord As Word.Application
Set objWord = CreateObject("Word.Application")

With objWord
'Make the application visible.
.Visible = True

'Open the document.
.Documents.Open ("H:privacymerge.dot")

'Move to each bookmark and insert text from the form.
.ActiveDocument.Bookmarks("Title").Select
.Selection.Text = (CStr(Forms![frmPrivacy]![Title]))
.ActiveDocument.Bookmarks("FirstName").Select
.Selection.Text = (CStr(Forms![frmPrivacy]![FirstName]))
.ActiveDocument.Bookmarks("LastName").Select
.Selection.Text = (CStr(Forms![frmPrivacy]![LastName]))
.ActiveDocument.Bookmarks("Address1").Select
.Selection.Text = (CStr(Forms![frmPrivacy]![Address1]))
.ActiveDocument.Bookmarks("Address2").Select
.Selection.Text = (CStr(Forms![frmPrivacy]![Address2]))
.ActiveDocument.Bookmarks("State").Select
.Selection.Text = (CStr(Forms![frmPrivacy]![State]))
.ActiveDocument.Bookmarks("PostCode").Select
.Selection.Text = (CStr(Forms![frmPrivacy]![Postcode]))

End With


'Print the document in the foreground so Microsoft Word will not close
'until the document finishes printing.
objWord.ActiveDocument.PrintOut
Do While objWord.BackgroundPrintingStatus > 0
Loop

'Close the document without saving changes.
objWord.ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges

'Quit Microsoft Word and release the object variable.
objWord.Quit
Set objWord = CreateObject("Word.Application")

Exit Sub

MergeButton_Err:
'If a field on the form is empty, remove the bookmark text, and
'continue.
If Err.Number = 94 Then
objWord.Selection.Text = ""
Resume Next

End If

Exit Sub

End Sub

The above code only mail merges and prints the record that the form is currently on, so one record at a time. I need the mail merge to print all records when the query is run. I was thinking of doing a loop with the number of records so it prints all records but have no idea of how to go about it. Any ideas or suggestions?

Merge Print
Hi All,

I have a word 2000 document which has a list of field names and the associated symbols. I call a template in VB which is setup to merge with the merge document. I then insert the fieldnames into the template (IN VB CODE) no probs, then I set it to print.
However on a PC with OFFICE 2003 on it come up with an SQL error giving select * from ... and only shows the field names not the images.

Any ideas,

Cheers

Jiggy!

Print Using Mail Merge
Hi you all..

Is it any one out there who knows how to display and print information, taken from a listview, i in a word application. The printing have a figured out but only by displaying the info using bookmarks. I want to use tables instead.. Any ideas..

Here is the code so far (uses bookmarks)..


Code:
Private Sub cmdPrintOrder_Click()

Dim referens As String
Dim WordObject As Word.Application

Set rs = New ADODB.Recordset
referens = "SELECT kontaktperson FROM Leverantör WHERE levnr = " & lstOrder.SelectedItem & ""
Call db(cn)
rs.Open referens, cn, adOpenForwardOnly, adLockReadOnly

Set WordObject = CreateObject("Word.Application")

With WordObject
.Documents.Open ("C:Documents and SettingsAdministratörSkrivbordorder.doc")
.ActiveDocument.Bookmarks("ordernr").Select
' reapply the boomark name to the selection
'.ActiveDocument.Bookmarks.Add Name:="First",Range:=Selection.Range
radindex = 1
Do While radindex <= (lstOrder.ListItems.Count)
.ActiveDocument.Bookmarks("suppliername").Select
.Selection.Text = (lstOrder.ListItems.Item(radindex).ListSubItems(1))
.ActiveDocument.Bookmarks("productnr").Select
.Selection.Text = (lstOrder.ListItems.Item(radindex).ListSubItems(4))
.ActiveDocument.Bookmarks("productname").Select
.Selection.Text = (lstOrder.ListItems.Item(radindex).ListSubItems(4))
.ActiveDocument.Bookmarks("qvantity").Select
.Selection.Text = (lstOrder.ListItems.Item(radindex).ListSubItems(5))
radindex = radindex + 1
Loop
.ActiveDocument.Bookmarks("date").Select
.Selection.Text = (Date)
.ActiveDocument.Bookmarks("kontactperson").Select
.Selection.Text = (rs![kontaktperson])
End With
WordObject.Visible = False
WordObject.ActiveDocument.PrintOut Background:=False
WordObject.ActiveDocument.SaveAs FileName:="x.doc"
' setting the printing to background will display the document
' on the screen while it is being printed
' WordObject.Documents.Close '("c:program filesqcap ransmove.doc")
WordObject.Application.Documents.Close
Set WordObject = Nothing

End Sub

Mail Merge Print Problems
I have a recordset that can contain anywhere from 2 - 2000 records that needs to be merged and printed. My code will print 1 fine, but when its more than 1, only prints the first 1...

Any ideas????

Private Sub cmdSubmitMail_Click()
Dim objClient As BizClient
Dim objWord As New Word.Application
Dim objDoc As Word.Document
Dim intLoop As Integer


If modUtils.FileExists(txtDocPath.Text) And modUtils.ListBoxItemsSelected(lstMail) > 0 Then


For Each objClient In mcolMailClients


If modUtils.IsListBoxItemSelected(objClient.fldID, lstMail) Then
Set objDoc = objWord.Application.Documents.Add(txtDocPath.Text, False, wdNewBlankDocument)

With objDoc
.Bookmarks("CCompanyName").Range.InsertAfter objClient.fldCompanyName
.Bookmarks("CLastName").Range.InsertAfter objClient.fldLastName
.Bookmarks("CFirstName").Range.InsertAfter objClient.fldFirstName
.Bookmarks("CAddress").Range.InsertAfter objClient.fldAddress
.Bookmarks("CCity").Range.InsertAfter objClient.fldCity
If objClient.fldProvinceStateID <> 0 Then
.Bookmarks("CState").Range.InsertAfter modLookUpList.ProvincesStates.Item(objClient.fldProvinceStateID).fldName
End If
.Bookmarks("CPostalCode").Range.InsertAfter objClient.fldPostalZipCode
If objClient.fldCountryID <> 0 Then
.Bookmarks("CCountry").Range.InsertAfter modLookUpList.Countries.Item(objClient.fldCountryID).fldName
End If
End With
objWord.PrintOut True
objDoc.Close False
End If
Next

objWord.Quit False
Set objWord = Nothing

Else

End If
End Sub

Basic Word - A Simple Find, Print Current, Find Next, Print
This is a really simple code used as a macro in Word that finds, prints the current page it found it on, finds next, print, etc. The problem in my code is that I need to find a way for it to stop at the end of the page <the loops i've put in won't stop.. i dont know the end of page function ?? or something along the lines>. So basically I just need this to keep looping until it reaches the bottom of the page. Here's what I have :

Selection.Find.ClearFormatting
With Selection.Find
.Text = "NO"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Application.PrintOut FileName:="", Range:=wdPrintCurrentPage, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
Collate:=True, Background:=False, PrintToFile:=False

Thanks in advance for your help.

Jeff

Mail Merge/duplex Print/barcodes
I need to do a mail merge letter which will have various fields for data. Also, I need to enable duplex printing to print the barcodes and the addresses on the reverse side of the document.
And finally, the letters have to be directly spooled to the printer without opening.

Please suggest me with some appropriate sample program how could we accomplish this.
Thanx

To Merge Different Word Files Into Single Word File
hi
I want to merge different word files in a single word file
these files are in different formats, means these can be in portrait or landscape modes and can have
different margins.

Pls suggest me how to do?
best regards

To Merge Different Word Files Into Single Word File
hi
I want to merge different word files in a single word file
these files are in different formats, means these can be in portrait or landscape modes and can have
different margins.

Pls suggest me how to do?
best regards

To Merge Different Word Files Into Single Word File
Hi
I want to merge different word files in a single word file
these files are in different formats, means these can be in portrait or landscape modes and can have
different margins.

Pls suggest me how to do?
best regards

Naming Word Files From A Merge File
I have a merge file set up. I made a macro where you enter the range of people that you want to make individual .doc files for. For now, I have a message box come up so you can type in the name that you want for the new merged file.

I want to change the programming so that the message box doesn't have to pop up, and the macro reads the merged data from either the word file or the excel file (if necessary) to name the file itself and make it completely automated.

My issue, then, is what commands do I use to be able to get merge field data into the macro programming? ie,

FirstName = (programming needed to pull the mergefield known as "firstname")
LastName = (programming needed to pull the mergefield known as "lastname")

Any help may result in the receipt of my first-born son.

via paypal of course

Thanks!

Word VBA / Macro Problem With Print &amp; Browser (Word 2000)
I am trying to use a macro inside the AutoOpen() event of a Word doc so that when the Word doc is opened inside IE, it will print the Word doc then close both the Word doc and the IE window. For some reason, VBA loses its reference to the doc object and IE Application object after the PrintOut line is executed. I have tried things like:
 Sub AutoOpen()
    MyWord.Visible = False
    MyWord.ActiveDocument.PrintOut
    MyWord.ActiveDocument.Close False
End Sub
or:
Sub AutoOpen()
  With ActiveDocument
     .PrintOut Background:=False
     .Close savechanges:=False
     .Parent.Quit
  End With
End Sub
or:
Sub AutoOpen()
    Dim MyWord As Object
    Set MyWord = GetObject(, "Word.Application")
    Dim IE As Object
    Dim IEDoc As Object
    Set IE = GetObject(, "InternetExplorer.Application")
    Set IEDoc = MyWord.ActiveDocument
    IEDoc.PrintOut
    IEDoc.Close
    IE.Quit
End Sub

But whatever I try, the Word doc prints, then throws a 4605 error about the method or property not being available because the document is in another app. Any ideas?

Thanks,
Chris

Extract Each Word From A String And Print One Word Per Line.
I have a textbox that contains a string(can be any number of words).

How do i extract each word from the string and
print one word per line onto the form? e.g.

textbox:
Hi can someone please help me

Print to form:
Hi
can
someone
please
help
me


Thanks

Excel Closes, But Word Doesn't! And Word Won't Print!
Hello:
   My code needs to open Excel, populate a table with data, mail-merge that table with a Word document, and finally print the merged documents. I have two problems:

1) As the program finishes, Excel closes and is removed from the Task Manager's Processes list, but Word is not removed. I've tried the .Quit method for both (even accounting for Word's use of parameters), but "WINWORD.EXE" remains on the list even after "EXCEL.EXE" is removed. I also set my objects to Nothing in Class_Terminate, but still no luck - and putting the .Close/.Quit procedures under Class_Terminate gave me an error. I know Excel is working because the program is saving my .xls files, but I'm not sure about Word. Which leads to...

2) Obviously I'm only opening Word to merge the file - the text of the document itself never changes so it doesn't need to be saved, just linked to the data source (the Excel table just created). But I can't get Word to print! I set the .ActivePrinter property and used .PrintOut but no luck. What do I have wrong here? Thanks for any insight.

Jeff W.
Owen, Little and Assoc., Inc.
Beachwood, NJ

P.S. This code runs from within ArcMap, a digital-mapping software package. Hence all of the "ICommand"s and "IMap"s and such, the use of "ISelectionSet" to populate the Excel table, etc. All of the code pertaining to ArcMap works fine - it's mostly just the part at the end of the code relating to Word where there must be something I'm doing wrong.

Code:Option Explicit

Implements ICommand

Private m_pApp As IApplication                                         
Private m_pMxDoc As IMxDocument
Private m_pMap As IMap
Private m_pExt As IExtension
Private m_pFeature As IFeature
Private m_pFeatureLayer As IFeatureLayer
Private m_pFeatureCursor As IFeatureCursor
Private m_pFeatureSelection As IFeatureSelection
Private m_pSelectionSet As ISelectionSet
Private m_pFields As IFields
Private m_pField As IField
Private m_pRow As IRow
Private m_pCursor As ICursor
Private m_pQBLayer As IQueryByLayer
Private m_pBitmap As IPictureDisp

Private m_pAppExcel As New Excel.Application
Private m_pWorkbook As Excel.Workbook
Private m_pWorksheet As Excel.Worksheet

Private m_pAppWord As New Word.Application
Private m_pDocument As New Word.Document
Private m_pMailMerge As MailMerge

Private Sub Class_Initialize()
   Set m_pBitmap = LoadResPicture(101, vbResBitmap)         'Button icon
End Sub

Private Sub Class_Terminate()
   Set m_pApp = Nothing
   Set m_pMxDoc = Nothing
   Set m_pMap = Nothing
   Set m_pExt = Nothing
   Set m_pFeature = Nothing
   Set m_pFeatureLayer = Nothing
   Set m_pFeatureCursor = Nothing
   Set m_pFeatureSelection = Nothing
   Set m_pSelectionSet = Nothing
   Set m_pFields = Nothing
   Set m_pField = Nothing
   Set m_pRow = Nothing
   Set m_pCursor = Nothing
   Set m_pQBLayer = Nothing
   Set m_pBitmap = Nothing

   Set m_pAppExcel = Nothing
   Set m_pWorkbook = Nothing
   Set m_pWorksheet = Nothing

   Set m_pAppWord = Nothing
   Set m_pDocument = Nothing
   Set m_pMailMerge = Nothing
End Sub
'
'ICommand members
'
Private Property Get ICommand_Bitmap() As esriSystem.OLE_HANDLE
   ICommand_Bitmap = m_pBitmap
End Property

Private Property Get ICommand_Caption() As String
   ICommand_Caption = "200' List"
End Property
 
Private Property Get ICommand_Category() As String
   ICommand_Category = "Extending ArcObjects"
End Property

Private Property Get ICommand_Checked() As Boolean
   ICommand_Checked = False
End Property

Private Property Get ICommand_Enabled() As Boolean
   ICommand_Enabled = True
End Property

Private Property Get ICommand_HelpContextID() As Long

End Property

Private Property Get ICommand_HelpFile() As String

End Property

Private Property Get ICommand_Message() As String
   ICommand_Message = "Creates a 200' list for selected property and generates an Excel file (for mail merge)"
End Property
 
Private Property Get ICommand_Name() As String
   ICommand_Name = "ExtendingArcObjects_200FootList"
End Property
 
Private Property Get ICommand_Tooltip() As String
   ICommand_Tooltip = "Create a 200' list"
End Property

Private Sub ICommand_OnCreate(ByVal hook As Object)
   Dim a As New UID
   
   Set m_pApp = hook
   a.Value = "CmdToolbarExt.clsLaunchExtension"
   Set m_pExt = m_pApp.FindExtensionByName("200FootListExtension")
End Sub

Private Sub ICommand_OnClick()             ''MAIN BUTTON
   Dim a As Long              'Field (i.e. column) value
   Dim b As Long             'b-d: counters
   Dim c As Long
   Dim d As Long
   Dim lMaxSize(8) As Long             'Width of each field
   Dim sValue As String             'Current record's value (string)
   Dim lHolder As Long             'Temp. field width value
   Dim sFieldName(8) As String
   Dim sBlock As String
   Dim sLot As String
   Dim sFirstRecord As String              'Holds IDNum of 1st selected record
   Dim sFileName As String
   
   sFieldName(0) = "IDNum"
   sFieldName(1) = "Block"
   sFieldName(2) = "Lot"
   sFieldName(3) = "FULLNAME"
   sFieldName(4) = "ADDRESS"
   sFieldName(5) = "CITY"
   sFieldName(6) = "STATE"
   sFieldName(7) = "ZIP"
   sFieldName(8) = "PROPLOC"
   
   Set m_pMxDoc = m_pApp.Document
   Set m_pMap = m_pMxDoc.FocusMap
   Set m_pFeatureLayer = m_pMxDoc.FocusMap.Layer(0)         '!!Change to reflect name
   Set m_pFeatureSelection = m_pFeatureLayer         ' of parcel layer!!
   Set m_pCursor = m_pFeatureLayer.Search(Nothing, False)
                                                      
                                                                            'Create Excel file name
   Call m_pFeatureSelection.SelectionSet.Search(Nothing, False, m_pFeatureCursor)
   Set m_pFeature = m_pFeatureCursor.NextFeature
   sFirstRecord = "Block" & m_pFeature.Value(m_pFeature.Fields.FindField("Block")) & "Lot" & _
                  m_pFeature.Value(m_pFeature.Fields.FindField("Lot"))
   
   Set m_pQBLayer = New QueryByLayer
   
   With m_pQBLayer             'Select all parcels within 200 feet
      Set .ByLayer = m_pFeatureLayer             ' of the selected parcel
      Set .FromLayer = m_pFeatureLayer
      .BufferDistance = 200
      .BufferUnits = esriFeet
      .ResultType = esriSelectionResultAdd
      .LayerSelectionMethod = esriLayerSelectWithinADistance
      .UseSelectedFeatures = True
      Set m_pFeatureSelection.SelectionSet = .Select
   End With

   Set m_pSelectionSet = m_pFeatureSelection.SelectionSet
   Call m_pSelectionSet.Search(Nothing, False, m_pCursor)

   Set m_pFields = m_pCursor.Fields
   Set m_pRow = m_pCursor.NextRow

   m_pMxDoc.ActiveView.Refresh
 
'*******************************mostly ArcMap code above this line************
'*******************************mostly VBA code below this line***************
                                                     
   Set m_pAppExcel = CreateObject("excel.application")         'Create Excel instance
   Set m_pWorkbook = m_pAppExcel.Workbooks.Add         'Create workbook/worksheet
   Set m_pWorksheet = m_pWorkbook.Sheets.Add(After:=m_pWorkbook.Sheets(m_pWorkbook.Sheets.Count))
   
   Cells(1, 1).Value = "IDNumber"             'Field names
   Cells(1, 2).Value = "Block"
   Cells(1, 3).Value = "Lot"
   Cells(1, 4).Value = "Name"
   Cells(1, 5).Value = "Address"
   Cells(1, 6).Value = "City"
   Cells(1, 7).Value = "State"
   Cells(1, 8).Value = "ZIP"
   Cells(1, 9).Value = "Property Loc."
   
   m_pAppExcel.DisplayAlerts = False             'Kill first three sheets
   Worksheets("Sheet1").Delete
   Worksheets("Sheet2").Delete
   Worksheets("Sheet3").Delete
   m_pAppExcel.DisplayAlerts = True
   m_pWorksheet.Activate
   m_pWorksheet.Name = "200 Foot List"
   m_pWorksheet.Rows(1).Font.Bold = True
   
   c = 1
   d = 1
   
   Do While Not m_pRow Is Nothing             'Grab values from selection set
      c = c + 1
      
      For b = 0 To 8
         a = m_pFields.FindField(sFieldName(b))
         m_pWorksheet.Cells(c, d).Value = m_pRow.Value(a)         'Write value to record
         sValue = m_pRow.Value(a)
         
         If c = 2 Then             'Find the longest entry in each field
            lMaxSize(b) = Len(sValue)
         Else
            lHolder = Len(sValue)
            
            If lHolder > lMaxSize(b) Then
               lMaxSize(b) = lHolder
            End If
            
         End If
         
         d = d + 1
      Next b
      
      Set m_pRow = m_pCursor.NextRow
      d = 1
   Loop
                                                      
   If lMaxSize(0) < 10 Then lMaxSize(0) = 10         'Minimum widths for fields
   If lMaxSize(1) < 6 Then lMaxSize(1) = 6
   If lMaxSize(2) < 4 Then lMaxSize(2) = 4
   If lMaxSize(3) < 6 Then lMaxSize(3) = 6
   If lMaxSize(4) < 8 Then lMaxSize(4) = 8
   If lMaxSize(5) < 4 Then lMaxSize(5) = 4
   If lMaxSize(7) < 6 Then lMaxSize(7) = 6
   If lMaxSize(8) < 13 Then lMaxSize(8) = 13
                                                      
   m_pWorksheet.Columns("A").ColumnWidth = lMaxSize(0)         'Set field widths
   m_pWorksheet.Columns("B").ColumnWidth = lMaxSize(1)
   m_pWorksheet.Columns("C").ColumnWidth = lMaxSize(2)
   m_pWorksheet.Columns("D").ColumnWidth = lMaxSize(3)
   m_pWorksheet.Columns("E").ColumnWidth = lMaxSize(4)
   m_pWorksheet.Columns("F").ColumnWidth = lMaxSize(5)
   m_pWorksheet.Columns("G").ColumnWidth = lMaxSize(6)
   m_pWorksheet.Columns("H").ColumnWidth = lMaxSize(7)
   m_pWorksheet.Columns("I").ColumnWidth = lMaxSize(8)
   
   sFileName = "C:200FootList_" & sFirstRecord & ".xls"
   
   Call m_pWorksheet.SaveAs(sFileName)         'Save Excel file (for this instance)
   m_pAppExcel.DisplayAlerts = False
   Call m_pWorksheet.SaveAs("C:200FootListMerger.xls")         'Save dummy copy of Excel file
   m_pAppExcel.DisplayAlerts = True             ' for mail merge (always overwrites)
   Call m_pWorkbook.Close
   Call m_pAppExcel.Application.Quit             'Quit Excel
   
   Set m_pAppWord = CreateObject("word.application")         'Create Word instance
   m_pAppWord.ActivePrinter = "\DellserverSHARP407 on Ne04:"

                                                                            'Open document for mail merge
   Set m_pDocument = m_pAppWord.Documents.Open("C:MailMerge.doc")

   Call m_pDocument.MailMerge.OpenDataSource("C:200FootListMerger.xls")
   m_pDocument.MailMerge.Destination = wdSendToNewDocument
   m_pDocument.MailMerge.Execute

   Call m_pDocument.PrintOut             'Print letters
   Call m_pDocument.Close
   Call m_pAppWord.Application.Quit(False)             'Quit Word
End Sub

Problem With Print, Page Setup, And Print Preview In A Text Editor...
Yes, I have another question.

When I use these exact same functions (with WebBrowser.ExecWB in place of txtScrapbook.Text) in my web browser, it works perfectly. But when I use them in reference to a text box, it doesn't.

Can you tell me where the problem lies, or give me an alternative method? I have a common dialog box already for other functions, so feel free to make use of it if you need to. Thanks.

Code:Private Sub PageSetup_Click()
txtScrapbook.Text OLECMDID_PAGESETUP, OLECMDEXECOPT_DODEFAULT
'opens page setup dialog
End Sub

Private Sub Print_Click()
txtScrapbook.Text OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER
'opens common dialog box prompting user to print current web page/parts of current web page
End Sub

Private Sub PrintPreview_Click()
txtScrapbook.Text OLECMDID_PRINTPREVIEW, OLECMDEXECOPT_DODEFAULT
'opens print preview dialog
End Sub

CRYSTAL REPORTS 9 DOES NOT PRINT THE SECOND TIME I CLICK THE PRINT BUTTON ON MY VB6 FORM
the first time i click the print button on my vb6 form the report appears on the screen but on subsequent clicks it does not

the code i have written is follows

private sub commandprint_click
  
     dim CRAPP AS CRAXDRT.APPLICATION
     dim REPORT AS REPORT


     APPPATH = "C:WFBIN"
     REPORTPATH = APPPATH + "" +"INVOICE.RPT"

     SET CRAPP = NEW ARAXDRT.APPLICATION
     SET REPORT = CRAPP.OPENREPORT(REPORTPATH)

     frmmain.crviewer91.reportsource = REPORT
     frmmain.crviewer91.viewreport

    SET CRAPP = NOTHING
    SET REPORT = NOTHING

end sub


is there anyting missing ? Kindly help at the earliest

How To Print Images That Fit To The Page Size Specified In Print Common Dialog?
i need some help in printing the whole image tat fit onto the paper size i specified in Print Common Dialog. I hav a PictureBox array & each PictureBox contains a smaller Picturebox inside. For example : Picture1(index) has a smaller Picture2(index) inside. There are vertical & horizontal scrollbars next to each Picture1(index).

i already hav the basic Print Common Dialog code below. Here's the problem -> I can print out the pictures displayed inside Picture2(index) but the printout will turn out truncated or just part of the whole picture when im printing to a 4R photo size for example and the image displayed in Picture2(index) is larger then the bounding Picture1(index) & i need to use the scrollbars to scroll and view the other portions of the image.

So how to modify the code below to print out the whole image tat fit nicely to the paper size i specified. Thanxs.


'---------------------------------------------------------------------
'CODE
'---------------------------------------------------------------------

CommonDialog1.CancelError = True
On Error Resume Next

CommonDialog1.Action = 5 ' Start the Print Common Dialog

If (Err.Number = cdlCancel) Then Exit Sub
'when Cancel is pressed, exit subroutine

'Code to print the array here

For Pics = Picture2.LBound To Picture2.UBound
If Picture2(Pics).Picture > 0 Then ' If the PictureBox is not empty
Printer.PaintPicture Picture2(Pics).Picture, 0, 0
Printer.EndDoc
End If
Next

'---------------------------------------------------------------------

Automatically Print Data Report Without Clicking Print Icon
is it possible to print records in the data report without loading it clicking on the print icon??? i want the printer to print my data report once i click a message box...but it shouldnt show any datareport...

Print Range Of Pages, Find Length Of Document To Print
Hi, I am trying to accomplish two things.
1) I would like to find out how many pages would print out, IF I were to print. ie. Warn the user: "You have asked to print out 500 sheets at $4.50 a sheet."
2) I would like to choose a range of pages to print out, without that range set as the "default" the next time the print function is called. So, my current printing method below is not what I would like. (Unless there is a way to restore defaults?) It displays the normal print dialog, and remembers the last print range entered by the user.

I am displaying web pages on a form within the webbrowser control. Some are very long, so these features are important to me. How it is done is less important. Any advice is appreciated. Thanks!

Here is my very simple example code:

Code:
Option Explicit

'Load a web page
Private Sub Command1_Click()
WebBrowser1.Navigate ("http://www.vbworld.com/")
End Sub


'Brings up the print dialog box on button click.
Private Sub Command3_Click()
Dim eQuery As OLECMDF
eQuery = WebBrowser1.QueryStatusWB(OLECMDID_PRINT)
If Err.Number = 0 Then
If eQuery And OLECMDF_ENABLED Then
WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER, "", ""
Else
End If
End If
End Sub

Private Sub cmdNavigate_Click()
Dim txtNavigate As String
WebBrowser1.Navigate txtNavigate
End Sub

How To Print Urdu Unicode Characters Using Printer.print Method ...??
Ive written a code for accepting input in text boxes in urd language and store it in access database and similarly i ca retrieve it back from the database and show it in the text boxe from the database in urdu language in vb6.0. But i cannot prin the same urdu unicode characters from the text boxes using th Printer.Print method, and if i do so i got ??????? (questio marks) printed instead of the urdu unicode characters. I eve tried the rich text boxe's selPrint method also but that als print the same ?????.
i wan to print the contents of the text boxes i.e unicod characters in urdu language.
Can anyone tell me how to do this as soon as possible ........??
Can anyone share with me the code for doing the above printing o unicode characters?

Waitin for the reply as earliest .......!!!

Print Error 486: Can&#8217;t Print Image To This Type Of Printer
Hey all
Has anyone seen this error when trying to initiate printform? I am trying to printform in a loop and it gives me this error. The printall subroutine has my printform code. It works perfectly the first time but when it tries to move to the previous record and then print that one I get this error. I searched for information but only found one suggestion where someone suggested putting a time delay in there. I tried that and it still would not print the second time. Help please.......
Thanks so much
Kim

Here is my code:

Code: Private Sub cmdPrintAllForms_Click()
    On Error GoTo SubErr
    Dim i As Integer
    Dim rs As ADODB.Recordset
    
    Set oConn = New ADODB.Connection
    oConn.Open frmSplash.sConn
  
    strSQL = "select * from tblAircraftWO where work_order_no = " & txtWorkOrderNo.Text
    
    Set rs = New ADODB.Recordset
    rs.Open strSQL, oConn, adOpenKeyset, adLockOptimistic
    
    i = rs.RecordCount
    
    rs.AbsolutePosition = txtCardNo.Text
     
    Do While Not rs.BOF
        PrintAll
        
        rs.MovePrevious
        If Not rs.BOF Then
        RetrieveRecords
        End if
    Loop
        
    If rs.BOF Then
        rs.MoveFirst
        MsgBox "You are at the beginning."
    End If
   
SubExit:
    Exit Sub
    
SubErr:
    MsgBox Err.Number & ": " & Err.Description
    Resume SubExit
End Sub

How To Print Urdu Unicode Characters Using Printer.print Method ...??
Ive written a code for accepting input in text boxes in urdu language and store it in access database and similarly i can retrieve it back from the database and show it in the text boxes from the database in urdu language in vb6.0. But i cannot print the same urdu unicode characters from the text boxes using the Printer.Print method, and if i do so i got ??????? (question marks) printed instead of the urdu unicode characters. I even tried the rich text boxe's selPrint method also but that also print the same ?????.
i wan to print the contents of the text boxes i.e unicode characters in urdu language.
Can anyone tell me how to do this as soon as possible ........??
Can anyone share with me the code for doing the above printing of unicode characters?

Waitin for the reply as earliest .......!!!

Print Picture Box (print A Form That Is Too Large For The Screen Or Page)
I got a picture box (Picture1), which contain several picture box'es, labels and
Flex Grid tables, -which I would like to print. Picture1 is quite high (higher than the screen). I found some code that i modified, but the printing only get the labels proper. The Flex Grids and picture box'es only show the border, and not the contents.

Code:Private Const WM_PAINT = &HF
Private Const WM_PRINT = &H317
Private Const PRF_CLIENT = &H4& ' Draw the window's client area.
Private Const PRF_CHILDREN = &H10& ' Draw all visible child windows.
Private Const PRF_OWNED = &H20& ' Draw all owned windows.

Private Declare Function SendMessage Lib "user32" Alias _
   "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
   ByVal wParam As Long, ByVal lParam As Long) As Long


Private Sub Print_Click()
Dim rv As Long
   Me.ScaleMode = vbTwips ' default
   With Picture2
      .Top = Picture1.Top
      .Left = Picture1.Left
      .Width = Picture1.Width
      .Height = Picture1.Height
   End With
   Me.Visible = True
   DoEvents
   Picture1.SetFocus
   Picture2.AutoRedraw = True
   rv = SendMessage(Picture1.hwnd, WM_PAINT, Picture2.hDC, 0)
   rv = SendMessage(Picture1.hwnd, WM_PRINT, Picture2.hDC, _
   PRF_CHILDREN + PRF_CLIENT + PRF_OWNED)
   Picture2.Picture = Picture2.Image
   Picture2.AutoRedraw = False

   Printer.Print ""
   Printer.PaintPicture Picture2.Picture, 0, 0
   Printer.EndDoc
End Sub



Edited by - Zigar on 11/27/2003 3:31:21 AM

Printing Multiple MSWord Files. Files Do Not Print In The Same Order As Instructed By Code
I am printing multiple Word files from VB using the code indicated below. The order in which they come out of the printer is not the same as that followed by the code.

What can I do to get them to come out of the printer in the same exact order as executed by the code.

Code Used:

For nI = 0 to n

sFile = "File" & Trim(Str(nI)) & ".doc"

Documents.Open FileName:=sFile, ConfirmConversions:=False, ReadOnly:=
True, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="" , Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="",
Format:=wdOpenFormatAuto

ActiveDocument.PrintOut Range
            :=wdPrintAllDocument, Item:=wdPrintDocumentContent, Copies:=1, Pages:="",
             PageType:=wdPrintAllPages, Collate:=True, Background:=True, PrintToFile
            :=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0,
            PrintZoomPaperHeight:=0

        Documents.Close
        
        
Next

Print To Word
I looked arround but could't find anything...

I want to be able to print to Word, eather the current frame ot the current record. How do I do this?
is there samples out there...

Vb _ Ms Word Print
hi,

my code is

printer.font.size=14
printer.font.bold=true
printer.print "My company Name"
printer.font.size=10
printer.font.bold=false
printer.print "some text"
..
.
.
.
printer.enddoc
====

now in printer

My Company Name
some text

was printed


all i want is - to store the output in to a word document (no previews pls)

thanks in advance
ackid32

Word Does Not Print
Hello to all,

word2000 and vb6

When I run this in debug mode, I get me letters.
If I run this in RUNTIME mode, I get no letters.

here is where I think it does not work


objWordDocuments.Application.PrintOut



Do anyone have any idea what is going on here.

I spend a week on this but could not figured it out.

thanks a bunch.

Private Sub CmdCustomerLetter_Click()
call InitilizeWord
call CheckedBoxSelected
end sub

Private Sub InitilizeWord()

'CREATE MS WORD APPLICATION OBJECT.
If TypeName(objWordApplication) = "Application" Then
Set objWordApplication = GetObject(, "Word.Application")
Else
Set objWordApplication = CreateObject("Word.Application")
End If
Set objWordDocuments = objWordApplication.Documents
Exit Sub
end sub

Private Sub CheckedBoxSelected()
Dim k As Integer


If Me.LvwCust.ListItems.Count > 1 Then
For k = 1 To Me.LvwCust.ListItems.Count
If Me.LvwCust.ListItems.Item(k).Checked Then
Call GetBkMark(k)
End If
Next k
End If
End Sub

Private Sub GetBkMark(ByVal SelItemIndex As Integer)
'*************************************************************************************************** *****************


Dim strPathName As String
Dim strFileName As String
Dim j As Integer
Dim objTemplate As Word.Document
Dim k As Integer


strPathName = App.Path & ""
strFileName = "Customer.dot"

Set objWordDocuments = objWordApplication.Documents
'Set objTemplate = objWordDocuments.Add(strPathName & strFileName, True, wdNewBlankDocument, True)

For k = 1 To Me.LvwCust.ListItems.Count
If k = SelItemIndex Then
Set objTemplate = objWordDocuments.Add(strPathName & strFileName, True, wdNewBlankDocument, True)
With objTemplate

If .Bookmarks.Exists("CustName") Then
.Bookmarks("CustName").Range.text =Trim(Me.LvwCust.ListItems.Item(k).SubItems(2)) & " " & Trim(Me.LvwCust.ListItems.Item(k).SubItems(1)))
End If
'ADDRESS
If .Bookmarks.Exists("Address") Then
.Bookmarks("Address").Range.text = Trim(Me.LvwCust.ListItems.Item(k).SubItems(5)))
End If
objWordDocuments.Application.PrintOut
End With
End If
Next k
End Sub

Print Word Doc...
I am using the following Sub to print a word document, but there are problems with it. I think the issue is the wordDoc.Close or Word.Quit lines. If I set the Word.Visible property to true, I get a 'Do you wish to close without finishing printing?' warning at one of these points, (I haven't bothered to check which), but I'd rather Word is not Visible, and so I need a way to make sure Word has sent the print job before executing these lines...
How can I do that?



Code:
Public Sub PrintWordDocument(FileName As String)
On Error GoTo WordError
Dim Word As Word.Application 'Opens word
Dim wordDoc As Word.Document 'creates document

frmInfo.Show
frmInfo.SetLabel ("Printing Word Document." & Chr(13) & "Please Wait...")
frmInfo.ZOrder 0

Set Word = CreateObject("Word.Application")
Set wordDoc = Word.Documents.Open(FileName)
Word.Visible = True 'False
wordDoc.PrintOut 'Prints Word Document
wordDoc.Close (wdDoNotSaveChanges) 'Close word without saving
Word.Quit

frmInfo.CloseWindow
Exit Sub

WordError:
frmInfo.CloseWindow
warning = MsgBox(Error, vbOKOnly, "Error!")
Set Word = Nothing
Set wordDoc = Nothing
End Sub

Print In Word
Hi!
I'm printing datas from vb with Word and I don't want the user to see anything.
When the user press the print button,
Word opens and set all the values correctly. Word is not visible.

Then I ask to print the document and to close Word.

The problem is that some printers don't have the time to spool the document before Word closes....

So it doesn't print....

If I cancel the Word close, it prints well.

So I need to make Word active until the document is spooled. And then close....

Any ideas????
tks!

Can You Print A Word Doc From A Web App?
I am trying to print a word doc (over our intranet) using vb.net and office 2000, and am having no luck. Is this not possible, or am I doing it wrong.

    When I attempt to execute this code I get the following error message: Server execution failed. I have included reference to the Word Library in my project. I have changed my path from the actual path to the virtual path and everything else I could think of to no avail.

Here is the code:
Code:Imports Word
Imports System
Imports System.Diagnostics
Imports System.ComponentModel

Public Class frmConfirm
    Inherits System.Web.UI.Page
    PrintDoc = "\bblweb
taspHirePacketHPDocs1.doc"
    Dim w As Word.Application
    Dim d As Word.Document
    w = New Word.Application
    d = w.Documents.Open(PrintDoc)
    d.PrintOut(False)
    d.Close()
    w.Quit()
    w = Nothing
End Sub


I have never posted a question on a site before and if I have done so incorrectly please tell me the correct way to do it.
and thanks,


 

Activate The Print Dialox Box When I Print A Data Report
Hello!

I use Visual Basic 6.0.

I have made differents reports with the Data Report component. My problem is when I try to print one of them. I use the next statement:

LlEsmArtReg.PrintReport True

The 'True' is becaruse I want show the Print Dialog Box.

My problem is that the Print Dialog Box not appear at the front, instead of that appears on the back. So the final user have to make a 'Alt+Tab' to see this Dialog Box.

Someone can tell me how to do for this Dialog Box appear at the front, automatically?

Thanks,
Eva Janakieff

I Awna Ask A Bout A Print Code That Can I Print Just What's In The Textbox
print just textbox code please guys
milen regard's

Adding Print Button Or Gettin Vb To Print My Application
Hi does ne1 know how to add a print Button to my application its a canculator i jus want it to print the page

Print Preview - How To Get The Real Print Size In Picture Box???
im previewing the print area in a picture box, but picture box
is little , How can I fit the page I want to print into the visible picture in picture box?
Im using a .bmp file as pic.

JCI

Vbform.print Problem For Msflexgrid Print On OS Win2000/XP
Hello,

I am trying to get my small report print on A4 size paper with vbform.print method (form contains VB components like textboxes/image/labels and MSFlexGrid) and is working properly using VB 6.0 (SP5) on OS win98, but when I try to print same with vbform.print method on OS win2000 OR winXP then it print report properly for all other components on form except the MSFlexGrid component.

All it prints is total black area for MSFlexGrid component. Any one have solution/reason to deal with it?

Thanks...

Print Problems Specifically Enddoc And Print Command
Hello, and welcome to my problem!

My code is below. My problem is this, it wont print, at all, sometimes when I shut the program down it will but not as it is here, or it sends an undefined error back when I hit the command button that holds this.

I just followed a tutorial I found on the net but not specific enough. please help.

Is there supposed to be a print icon with the other objects in the menu that holds the check boxes, list, comboboxes etc that I click and paste onto my form? If so were can I find it, if not who knows.


Private Sub Command1_Click()


Print

Printer.Print
Printer.Print
Printer.Print
Printer.Print
Printer.Print
Printer.Print
Printer.Print Spc(10),
Printer.Print Spc(10), "Selling Price", selltotal.Text, sellall.Text
Printer.Print Spc(10), "Item Cost", costtotal.Text, costall.Text
Printer.Print Spc(10), "Shipping", shiptotal.Text, shipall.Text
Printer.Print Spc(10), "Handling", handtotal.Text, handall.Text
Printer.Print Spc(10), "Other", othertotal.Text, otherall.Text
Printer.Print Spc(10),
Printer.Print Spc(10),
Printer.Print Spc(10),
Printer.Print Spc(10),
Printer.Print Spc(10), "Profit", profittotal.Text, profitall.Text
Printer.Print Spc(10),
Printer.Print Spc(10),
Printer.Print Spc(10),
Printer.NewPage
Printer.EndDoc

thank you ever so much

you should have seen what I could do on my PET

Print Command In Vb6 To Print A Range In An Excel Worksheetsheet
Thank you for you assistance in populating an excel sheet from a vb6 user form textbox.

I am now struggling to print the excel sheet from vb6 command button.

I can print the worksheet but it is blank as I cannot work out how to set the print range.

Assistance would be appreciated as, after hours of trying, I am about ready to scream!!

Monitoring Print Port And Duplicating Print Jobs
Hello Everyone,

I need some help please, Im working on a domain server, as you can see the image attached, this is my network layout... Now from there, I have it where my station 1-4 have there own printers and I want it that anything they print to be duplicated and to be printed on the laser printer.. basiclly all orders being printed from front counter, a second copy to be printed in the back office... I can't find any software that will do this, but someone told me what i can do is create a custom program to monitor the print ports, and any print thats send from the stations to send it to the network printer as a duplicate copy... can any1 help me with this.. I would really appricate it.

Thank You
DNG

Won't Print File {Word}
Hey,


I wrote the following code for printing a file:


Code:
Dim objDoc As Word.Document

Option Explicit
Dim afdrukken As Word.Application

... (the following part belongs to a button in a toolbar!)

Case 7

Printer.Font.Name = "arial"

Set afdrukken = New Word.Application
afdrukken.Visible = True

Set objDoc = afdrukken.Documents.Open(App.Path & "" & "KBC.doc")

Select Case fraafpunting.Caption

Case "Overzicht afpunting"

If optopen.Value = True Then

Selection.GoTo wdGoToBookmark, , , "Overzicht"
Selection.TypeText Text:=" afpunting openstaande boekingen per agent"
Selection.GoTo wdGoToBookmark, , , "BVVO:"
Selection.TypeText Text:=lstBVVO.Text
Selection.GoTo wdGoToBookmark, , , "Agent:"
Selection.TypeText Text:=lstagent.Text
Selection.GoTo wdGoToBookmark, , , "Maand:"
Selection.TypeText Text:="niet van toepassing"
Selection.GoTo wdGoToBookmark, , , "Winst/verlies:"
Selection.TypeText Text:="niet van toepassing"
Selection.GoTo wdGoToBookmark, , , "Tabel:"
Selection.TypeText Text:=datagridoverzicht

'datagrid afdrukken



ElseIf optwv.Value = True Then

Selection.GoTo wdGoToBookmark, , , "Overzicht"
Selection.TypeText Text:=" winst/verlies per agent"
Selection.GoTo wdGoToBookmark, , , "BVVO:"
Selection.TypeText Text:=lstBVVO.Text
Selection.GoTo wdGoToBookmark, , , "Agent:"
Selection.TypeText Text:=lstagent.Text
Selection.GoTo wdGoToBookmark, , , "Maand:"
Selection.TypeText Text:="niet van toepassing"
Selection.GoTo wdGoToBookmark, , , "Winst/verlies:"
Selection.TypeText Text:=txtwv.Text
Selection.GoTo wdGoToBookmark, , , "Tabel:"
Selection.TypeText Text:="niet van toepassing"

End If

Case "Overzicht winst/verlies van de afgesloten periodes"

If optpermed.Value = True Then

Selection.GoTo wdGoToBookmark, , , "Overzicht"
Selection.TypeText Text:=" winst/verlies van de afgesloten periode per BVVO"
Selection.GoTo wdGoToBookmark, , , "BVVO:"
Selection.TypeText Text:=lstBVVO.Text
Selection.GoTo wdGoToBookmark, , , "Agent:"
Selection.TypeText Text:=lstagent.Text
Selection.GoTo wdGoToBookmark, , , "Maand:"
Selection.TypeText Text:=lstmaand.Text
Selection.GoTo wdGoToBookmark, , , "Winst/verlies:"
Selection.TypeText Text:=txtwv.Text
Selection.GoTo wdGoToBookmark, , , "Tabel:"
Selection.TypeText Text:=" niet van toepassing"

ElseIf opttotaal.Value = True Then

Selection.GoTo wdGoToBookmark, , , "Overzicht"
Selection.TypeText Text:=" winst/verlies van de afgesloten periode over alle BVVO's heen"
Selection.GoTo wdGoToBookmark, , , "BVVO:"
Selection.TypeText Text:="alle BVVO's samen"
Selection.GoTo wdGoToBookmark, , , "Agent:"
Selection.TypeText Text:="niet van toepassing"
Selection.GoTo wdGoToBookmark, , , "Maand:"
Selection.TypeText Text:=lstmaand.Text
Selection.GoTo wdGoToBookmark, , , "Winst/verlies:"
Selection.TypeText Text:=txtwv.Text
Selection.GoTo wdGoToBookmark, , , "Tabel:"
Selection.TypeText Text:=" niet van toepassing"

End If

Case "Overzicht winst/verlies van het huidig boekjaar"

If optpermed.Value = True Then

Selection.GoTo wdGoToBookmark, , , "Overzicht"
Selection.TypeText Text:=" winst/verlies van het huidig boekjaar per BVVO tot op heden"
Selection.GoTo wdGoToBookmark, , , "BVVO:"
Selection.TypeText Text:=lstBVVO.Text
Selection.GoTo wdGoToBookmark, , , "Agent:"
Selection.TypeText Text:="niet van toepassing"
Selection.GoTo wdGoToBookmark, , , "Maand:"
Selection.TypeText Text:="begin van het boekjaar tot op heden"
Selection.GoTo wdGoToBookmark, , , "Winst/verlies:"
Selection.TypeText Text:=txtwv.Text
Selection.GoTo wdGoToBookmark, , , "Tabel:"
Selection.TypeText Text:=" niet van toepassing"

ElseIf opttotaal.Value = True Then

Selection.GoTo wdGoToBookmark, , , "Overzicht"
Selection.TypeText Text:=" winst/verlies over alle BVVO's heen tot op heden"
Selection.GoTo wdGoToBookmark, , , "BVVO:"
Selection.TypeText Text:="alle BVVO's samen"
Selection.GoTo wdGoToBookmark, , , "Agent:"
Selection.TypeText Text:="niet van toepassing"
Selection.GoTo wdGoToBookmark, , , "Maand:"
Selection.TypeText Text:="begin van het boekjaar tot op heden"
Selection.GoTo wdGoToBookmark, , , "Winst/verlies:"
Selection.TypeText Text:=txtwv.Text
Selection.GoTo wdGoToBookmark, , , "Tabel:"
Selection.TypeText Text:=" niet van toepassing"

End If

End Select

afdrukken.PrintOut


When I click on the print button, it opens the file, but it doesn't fill in the spaces and it doesn't print the file! What is the problem?

Word XP Label Print From VB6?
Hi I need a little help.
I have built an inventory managment system at work and need to be able to print out the labels to put on each piece of inventory. Will need to be able to query the database by a purchase order (done) take the resulting Serial Number and Stock item and put them on a label in Arial Font as well as have the same text next to them in Barcode font. The labels I am using already have a Avery/Word template number assigned, but I don't know how to call the document to start with the template and fill in that information dynamically. Each label will be different information, as looped through the dynaset from our Oracle database.

I will also need the ability to print out single labels as reprints on partial sheets, so I need to give the information to print as well as the row column to print to so as not waste a full sheet of labels.

The way I am currently doing it is to creat a blank table with certain cell padding and font size then manually print some samples and try and make them match up, but having problems with the single label print.

I think there must be an easier way to do this using the word templates, also allowing me to dynamically change them in case we decide to go with different labels or sized labels in the future.
Any help would be appreciated.
Thanks!

How To Print Lables From Word
hello all
let me start off by saying i have never tried to access word from vb there for i have no code to show for this question.
i have a program that runs the national dnc list against a database to see if the numbers are able to be dialed or not now the school that i wrote uit for wants the ability to click a button and print mailing lables for the ones that can not be called, i have all of the code writen to pull the records and i know that word can print labels ,expecially every template 8160. but i have no idea as to how to tell word to do it, i have office xp and vb6. i have searched forum and i see things like
dim wrd as word.document
wrd = new word.something or other

i do not have word as an option but i have word

i also read i would have to use mailmerge again i am stupit
just need a thrust in the right direction
thanks in advance

edit
ok after reading tutorials i have found that i have to reference it to show things after "."

edit
ok i can now open word document and place textr in it but how do i use the avery lables and merge in the data

still can not get to work

Print 1 To Many In A Word Document
Is is possible to create a mail merge through Acces 97 that will merge a main document trailed by a 1 to many list, similar to a main form/subform relationship?.....or would bookmarking be a better option?

Any help appreciated.
Thanks

Netbari

Print And Format Through Word. HELP??
I have a visual Basic application that is connected to a Microsoft Database. It saves records for patients. I want to be able to print a persons info in a certain format I create. Can someone help me figure this out. I am new to printing info from VB and am having a hard time. Should I use Microsoft Word and merge it there or a different way.

Thanks Nick

Dim Range As Word.Range
Dim Myw As Object

'if Word isnt open VB will raise an error, we dont need that
On Error Resume Next

'check if Word is open
Set Myw = GetObject(, "Word.application")

'if Word is not open
If Myw Is Nothing Then
Set Myw = GetObject("", "Word.Application")
Myw.Visible = True
End If

Do Not Print Buttons In Word
Does anyone know how not to have a VBA button print but still show in a word document. I have a button that shows up when certain criteria is met, and allows the user to do something else, but I do not want it to show on the final print.

I can do it in excel, but the property is not in the same place in Word (I am running XP).

I also really want to avoid custom menu's/toolbars for distribution nightmare reasons.

Thanks,

Can't Print And Close Word Right After
In Microsoft word I created a document using VB then I use the following code to print it out and try to close it. however when I try to close it, it says quitting word will cancel the print or something like that.

Here is my code that ends it:

objWord.PrintOut
objWord.ActiveDocument.Close (0)
objWord.Quit
Set objWord = Nothing

Whats wrong with this?

How Do I Print A Word.doc From My VB6 Project?
Hello
I am working on an application that creates a word.doc from information entered into text box's, and once it is saved, I then want to print this word.doc , from within my application. So one button does all "Save & Print"
I have got the doc to save, but do not know how to open this saved doc and print it!

Any help would be great!

How Does MS Word Print To File?
Try this one guys and gals:

Type a few words in MS Word then click print. Choose the print to file checkbox and then click print. Up comes a nifty little dialog box that let's you choose directories, etc.

Now try the same thing with Wordpad. You get a single textbox that doesn't include default file name, directories, etc.

I can get my program to print to file a la Wordpad, but I'd much rather it print to file like MS Word.

Any help?

PS, I've already got a form that lets you navigate directories, choose a file name and so forth. I just need a way to actually print to the file that I choose with the form.

Thanks in advance.

Print Word Document Using VBA
If anyone could help me out with this i'd be grateful.

Scenario---
I wish to automatically print out a word document when forced by me using VBA code. I have used the commondialog.showprinter statement to bring up the common dialog printer window (as required) yet when I click print the document is not printed. It just returns me to the code. How do I get this to print. Any ideas. Have I missed out initialising some value somwhere? Is there another way to print from within the VBA section for word (I NEED TO PROVIDE A LIST OF PRINTERS TO CHOOSE FROM - THAT IS WHY I AM USING THE COMMON DIALOG!!!"

VB6 Word Print [*Resolved*]
I am opening up a word document from a template using VB6.

Is there any way of the VB6 application knowing if the user has printed the document from word?


Thanks


Kev.

"I love deadlines. I like the whooshing sound they make as they fly by. " - Douglas Adams

MS Word Print Error
i have a vb app that prints records from a DB to ms word. i used bookmarks and just selected the bookmarks in the code and dumped the data in the word template based on the bookmark. this all worked fine until i put some code in for a check box. all the other bookmarks work but when i stepped through the code it said that- "The requested member of the collection does not exist". iahve another program that i used the same code to put check boxes into a word document and print and it worked. any one know why it is saying that the book mark isn't there when i know it is?

Copyright © 2005-08 www.BigResource.com, All rights reserved