Results 1 to 6 of 6

Thread: V.urgent

  1. #1

    Thread Starter
    Fanatic Member VisionIT's Avatar
    Join Date
    Nov 2002
    Location
    Workin'...
    Posts
    718

    V.urgent

    I have a form which extracts every field to a bookmark in a word document.. which is not a problem with Office XP, but it crashes out with Office 2k, HELP!

    I have searched through the references for something else to add, but maybe i'm missing something

    Any help would be much appreciated.

    Regards,

    Paul.

  2. #2

  3. #3

  4. #4

    Thread Starter
    Fanatic Member VisionIT's Avatar
    Join Date
    Nov 2002
    Location
    Workin'...
    Posts
    718
    Here is the code...

    VB Code:
    1. Private Sub Command1_Click()
    2. FileSystem.SetAttr ("c:\fleet aid ltd\estimates\" & boxestimateno & ".txt"), vbNormal
    3. Dim WordObject As Word.Application
    4. Set WordObject = CreateObject("Word.Application")
    5.  
    6.      With WordObject
    7.      .Documents.Open ("c:\Fleet Aid Ltd\config\invoice.doc")
    8.      .ActiveDocument.Bookmarks("estimateno").Select
    9.      .Selection.Text = (boxestimateno.Text)
    10.      .ActiveDocument.Bookmarks("yourref").Select
    11.      .Selection.Text = (boxyourref)
    12.      .ActiveDocument.Bookmarks("fao").Select
    13.      .Selection.Text = (boxfao.Text)
    14.      .ActiveDocument.Bookmarks("invoiceaddr1").Select
    15.      .Selection.Text = (boxinvoiceaddr1)
    16.      .ActiveDocument.Bookmarks("invoiceaddr2").Select
    17.      .Selection.Text = (boxinvoiceaddr2)
    18.      .ActiveDocument.Bookmarks("invoiceaddr3").Select
    19.      .Selection.Text = (boxinvoiceaddr3)
    20.      .ActiveDocument.Bookmarks("invoiceaddr4").Select
    21.      .Selection.Text = (boxinvoiceaddr4)
    22.      .ActiveDocument.Bookmarks("invoiceaddr5").Select
    23.      .Selection.Text = (boxinvoiceaddr5)
    24.      .ActiveDocument.Bookmarks("creditdate").Select
    25.      .Selection.Text = (boxinvoicedate)
    26.      .ActiveDocument.Bookmarks("regno").Select
    27.      .Selection.Text = (boxregno)
    28.      .ActiveDocument.Bookmarks("make").Select
    29.      .Selection.Text = (boxmake)
    30.      .ActiveDocument.Bookmarks("model").Select
    31.      .Selection.Text = (boxmodel)
    32.      .ActiveDocument.Bookmarks("part1").Select
    33.      .Selection.Text = (boxpart1)
    34.      .ActiveDocument.Bookmarks("part2").Select
    35.      .Selection.Text = (boxpart2)
    36.      .ActiveDocument.Bookmarks("part3").Select
    37.      .Selection.Text = (boxpart3)
    38.      .ActiveDocument.Bookmarks("cost1").Select
    39.      .Selection.Text = (boxpart4)
    40.      .ActiveDocument.Bookmarks("cost2").Select
    41.      .Selection.Text = (boxpart5)
    42.      .ActiveDocument.Bookmarks("cost3").Select
    43.      .Selection.Text = (boxcost3)
    44.      .ActiveDocument.Bookmarks("cost4").Select
    45.      .Selection.Text = (boxcost4)
    46.      .ActiveDocument.Bookmarks("cost5").Select
    47.      .Selection.Text = (boxcost5)
    48.      .ActiveDocument.Bookmarks("balancedue").Select
    49.      .Selection.Text = (boxbalance)
    50.      .ActiveDocument.Bookmarks("vat").Select
    51.      .Selection.Text = (boxvat)
    52.      .ActiveDocument.Bookmarks("total").Select
    53.      .Selection.Text = (boxtotal)
    54.      .ActiveDocument.Bookmarks("totalbottom").Select
    55.      .Selection.Text = (boxtotal)
    56.      .ActiveDocument.Bookmarks("invoiceaddr1bottom").Select
    57.      .Selection.Text = (boxinvoiceaddr1)
    58.      .ActiveDocument.Bookmarks("labour").Select
    59.      .Selection.Text = (boxlabour)
    60.      .ActiveDocument.Bookmarks("paint").Select
    61.      .Selection.Text = (boxpaint)
    62.      .ActiveDocument.Bookmarks("sundries").Select
    63.      .Selection.Text = (boxsundries)
    64.      .ActiveDocument.Bookmarks("assessor").Select
    65.      .Selection.Text = (boxassessor)
    66.      .ActiveDocument.Bookmarks("recovery").Select
    67.      .Selection.Text = (boxrecovery)
    68.      .ActiveDocument.Bookmarks("other").Select
    69.      .Selection.Text = (boxothercharge)
    70.      .ActiveDocument.Bookmarks("optiflex").Select
    71.      .Selection.Text = (boxoptiflex)
    72.      .ActiveDocument.Bookmarks("lubricants").Select
    73.      .Selection.Text = (boxlubricants)
    74.      .ActiveDocument.Bookmarks("antifreeze").Select
    75.      .Selection.Text = (boxantifreeze)
    76.      .ActiveDocument.Bookmarks("rustproof").Select
    77.      .Selection.Text = (boxrustproof)
    78.      .ActiveDocument.Bookmarks("valeting").Select
    79.      .Selection.Text = (boxvaleting)
    80.      .ActiveDocument.Bookmarks("mot").Select
    81.      .Selection.Text = (boxMOT)
    82.     End With
    83.    WordObject.Visible = False
    84.        
    85.        WordObject.ActiveDocument.PrintOut
    86.        WordObject.ActiveDocument.PrintOut
    87.        WordObject.ActiveDocument.PrintOut
    88.        WordObject.ActiveDocument.SaveAs FileName:=("c:\Fleet Aid ltd\printedinvoices\" & boxestimateno.Text)
    89.        WordObject.ActiveDocument.Close
    90. End Sub

    Any ideas, please...

    Regards,

    Paul.

  5. #5

  6. #6

    Thread Starter
    Fanatic Member VisionIT's Avatar
    Join Date
    Nov 2002
    Location
    Workin'...
    Posts
    718

    :: SOLVED ::



    Don't worry all, i've solved it. I activated Word 10.0 reference, which automatically removes all other word references like Word 9.0 (the one i wanted)

    I just removed word 10.0 and word 9.0 appeared !

    Thanks anyway for the quick response...

    Regards,

    Paul.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width