Results 1 to 10 of 10
  1. #1
    2 Star Lounger
    Join Date
    Sep 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Publish it with Word (Access 97)

    Hi

    When a report (displayed in preview) is exported to MS Word using the built-in MS Access Publish it with MS Word command the attached error message occurs. However, it works fine on my machine. Initially, I thought the user's c: drive may have been too full to create the temp file, but the same error message occurs on another user's machine.

    The report is fairly straightword, ie no subreports and no complicated formating.

    Has anyone got any ideas on the cause of the problem and a solution?

    Thanks & Regards
    WTH
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Publish it with Word (Access 97)

    Does the user have a document of the same name open in Word when he tries to do this? That is what the error message suggests.
    Charlotte

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Publish it with Word (Access 97)

    Another thing to check: does the user have sufficient permissions in the destination folder? Where I work, users are not allowed to save files in the root of C:.

  4. #4
    2 Star Lounger
    Join Date
    Sep 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Publish it with Word (Access 97)

    Hi Guys

    Thanks for taking the time to reply. In answer to your questions.

    1 No the file is not already open on the user's machine
    2 The rtf file is been created on my h: drive (network drive). This is everyone's personal drive and there should be no restrictions on it. I presume on the other user machines it is trying to create the rtf file on their h: drive. Is there any way to check this?

    I set up a output to file option in a module and this worked fine on other users machines, so I'm not sure on why the built in menu publish it button is not working.

    My preferred option is for the user to preview the report and either print it or export it to word via menu option. However, I'm not sure this is possible to do using VB, rather than using the built in Access Publish it button. Any ideas?

    Thanks & Regards
    WTH

  5. #5
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Publish it with Word (Access 97)

    Unfortunately I can't test 97, but it should give you a dialog box where you want to save the file. You should also be aware that publishing reports to Word frequently results in a less that pretty document, as RTF (rich text format) has a number of limitiations, and no method for doing tables or lines or graphics of any kind.
    Wendell

  6. #6
    2 Star Lounger
    Join Date
    Sep 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Publish it with Word (Access 97)

    Hi

    Thanks for the reply.

    Not sure what you mean about dialog box being displayed. Are you talking about output to file method or the built in one? If the latter, then no option is given.

    Yes I realise the limitations of exporting to file, however as mentioned above, the report is rather basic so there are no real formatting issues. The client wishes to have this option so they can publish is on the web in either Word or PDF format.

    Regards
    WTH

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Publish it with Word (Access 97)

    In that case, take a careful look at your code and the design of the report. It may be trying to save to *your* h drive, which won't exist on the client machine. Even though you all may have a default personal drive of H:, the mapping may be to a different segment of the network.
    Charlotte

  8. #8
    2 Star Lounger
    Join Date
    Sep 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Publish it with Word (Access 97)

    Hi Charlotte

    On further testing I think I have determined the issue, but I am unsure of the solution.
    In my setup of Access I have set under Tools, Options, General the default folder as h: drive.

    However, it seems everyone else's is set to I: drive, which users can not write to. So this causes the problem with the built in publish it button as it is trying to write to the default drive. I tested this in the output to method module by including or excluding the drive eg 'h:filename" v "filename". The latter works for me only as I have set the default folder as h:, while the former works for all.

    So can I use VB to set a user's default folder to h: drive when they open the database?

    Regards
    WTH

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Publish it with Word (Access 97)

    1. You can create a function (in a standard module):

    Public Function ReportToRTF()
    DoCmd.OutputTo acOutputReport, , acFormatRTF
    End Function

    and assign this function as action of a custom toolbar button. This function will prompt the user for a location to save the RTF file.

    2. You can set the default database directory as follows:

    Application.SetOption "Default Database Directory", "H:"

    (And you can use GetOption("Default Database Directory") to retrieve the current setting)

  10. #10
    2 Star Lounger
    Join Date
    Sep 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Publish it with Word (Access 97)

    Hi Hans

    <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    Many thanks (and to the others for their help), using the 2nd option fixed the problem. Now it's time to have a word with IT on why they set the default drive to a read only directory.

    Regards

    WTH

Posting Permissions

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