Results 1 to 9 of 9
  1. #1
    Join Date
    May 2007
    Posts
    37

    Smile Unanswered: create a doc within accss

    I would like to: 1. Create a word document from in the Access DataBase.
    2. Save it's location in the person's record so I could refer
    to it in a later date.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    ...so whats stopping you?

    what have you tried so far?
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    May 2007
    Posts
    37

    cont. word from access

    1. I,ve put this code under the on_click buttun:
    Set objWord = CreateObject("Word.Application")
    objWord.Visible = True
    objWord.Documents.Add
    2. and it opens a blank document
    3. after saving the document in a specific location I would like this
    location to be stored automatically in the a the person's record.
    4. later I would like to choose a specific location of one of the documents from the combo_box to view it.

    thank's for the reply

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so what have you tried?
    have you picked up the location the file was saved?
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    May 2007
    Posts
    37
    I would like to pick up the location of the saved file automatically and save it a the person's record.

    thank's

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    That's not answering healdem's questions, is it?
    I think we understand the problem but we want to know how far you are with it.
    People will not do your work for you but help you achieve your goal. They will not help you if you are not willing to help yourself and give it a try.
    George
    Home | Blog

  7. #7
    Join Date
    May 2007
    Posts
    37
    Dear georgev!
    My question was how to pick up the location of the saved file so I could use it for a later use.

  8. #8
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    The code has created a blank document. It would be like opening Word to a new blank document, until you save it, there is no location. When you choose to save the document, that is when you need to tell it the location.

  9. #9
    Join Date
    May 2007
    Posts
    37
    Thank you for your reply!

    I have found a solution and this the code:


    Dim Ws_Date, Ws_Replaced_Date, Ws_Time, Ws_Replaced_Time As String

    Ws_Date = Date
    Ws_Replaced_Date = Replace(Ws_Date, "/", "")

    Ws_Time = Time
    Ws_Replaced_Time = Replace(Ws_Time, ":", "")

    Dim objWord As Object
    Dim ffile As String
    Set objWord = CreateObject("Word.Application")
    objWord.Visible = True
    ffile = Application.CurrentProject.Path & "\" & Me.Cust_ID & Replaced_Date & Ws_Replaced_Time & ".doc"
    If Dir(ffile) <> "" Then
    objWord.Documents.Open ffile
    Else
    objWord.Documents.Add
    objWord.ActiveDocument.SaveAs ffile
    End If
    Set objWord = Nothing


    ================================================== ====
    Now, I have another problem that the filed "File_Out" is a Hyperlink field.
    How do I save the location with the syntex of Hyperink?
    ================================================== ====


    Dim db As Database
    Dim rst As Recordset
    Set db = DBEngine(0)(0)
    Set rs = db.OpenRecordset("Doc_Out", dbOpenTable)

    rs.AddNew
    rs("cust_Id") = Me.Cust_ID
    rs("remarks") = "Word File"
    rs("File_Out") = ffile
    rs("Date_entered") = Date
    rs.Update
    rs.Close

Posting Permissions

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