Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Location
    Sydney Australia
    Posts
    369

    Unanswered: Conversion problem with Access 95 to Access 2003

    I have changed data base from Access 95 to Office 2003 and all is well except for one area.

    One of the forms has a lot of labels and buttons which open a specific Word.doc and then via macros copies and Access field and then pastes it into a Bookmark in Word.

    DoCmd.RunMacro "CD1", , ""
    docName.EditGoTo "C2"
    docName.EditPaste

    There are whole series of the above attached to the label or button for the paricular Word.doc. The Word.doc opens OK and everything goes through to the end, that is, no errors, debugs pop up.

    The following is what a complet one looks like. At the end it copied the Word.doc and pastes it to an Access memo field. That all workd OK.

    The EditGoTo seems to be the problem as some Word.docs are opened and the EditGoTo is used simply to position the cursor but that does not work.

    Private Sub Label309_Click()
    DoCmd.RunMacro "Macro340", , ""
    DoCmd.RunMacro "Macro11", , ""

    Const MSTB_MSWORD = 300&

    Application.Run "utility.util_StartMSToolbarApp", MSTB_MSWORD

    Dim docName As Object
    Set docName = CreateObject("Word.Basic")

    docName.FileOpen "c:\Letters\0Letter1Mike.doc"
    docName.EditGoTo "a2"
    docName.EditPaste

    DoCmd.RunMacro "Macro11Street", , ""
    docName.EditGoTo "a3"
    docName.EditPaste

    DoCmd.RunMacro "Macro11Suburb", , ""
    docName.EditGoTo "a4"
    docName.EditPaste

    DoCmd.RunMacro "Macro11Salute", , ""
    docName.EditGoTo "a5"
    docName.EditPaste

    DoCmd.RunMacro "Macro11Date", , ""
    docName.EditGoTo "a1"
    docName.EditPaste

    DoCmd.RunMacro "LHName", , ""
    docName.EditGoTo "a6"
    docName.EditPaste

    DoCmd.RunMacro "LHAddress", , ""
    docName.EditGoTo "a7"
    docName.EditPaste

    DoCmd.RunMacro "LHPhone", , ""
    docName.EditGoTo "a8"
    docName.EditPaste

    DoCmd.RunMacro "LHDescription", , ""
    docName.EditGoTo "a11"
    docName.EditPaste

    docName.EditSelectAll
    docName.EditCopy
    docName.FilePrint
    docName.FileClose (2)

    DoCmd.GoToRecord , "", acNext
    DoCmd.Close acForm, "PrintandClose"

    DoCmd.OpenForm "LetterStoreRecord", acNormal, "", "", acEdit, acNormal
    DoCmd.GoToRecord , "", acNewRec

    DoCmd.SelectObject acForm, "LetterStoreRecord", False
    DoCmd.GoToControl "Letter"
    DoCmd.DoMenuItem 0, 1, 3, 0, acMenuVer70 ' Form, Edit, Paste

    DoCmd.DoMenuItem 0, 5, 4, 0, acMenuVer70 ' Form, Records, Save Record
    DoCmd.OpenForm "PrintandClose", acNormal, "", "", acEdit, acNormal
    Forms!PrintandClose.RecordSource = "GridJoinNamesSingle"
    DoCmd.RunMacro "Macro11TimerSingle", , ""

    Forms!LetterStoreRecord!Name = Forms![12ProspectT]![CL Surname]
    Forms!LetterStoreRecord!NameNumber = Forms![12ProspectT]!NameNumber
    Forms!LetterStoreRecord!Done = Now()

    DoCmd.Close acForm, "LetterStoreRecord"

    End Sub

  2. #2
    Join Date
    Apr 2004
    Location
    Sydney Australia
    Posts
    369
    BTT

    Any takers.

    Microsoft site seems to be saying that after 97 EditGoTo is a problem but I could not get their "work arounds" to work.

    Mike

Posting Permissions

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