Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2004
    Posts
    24

    Unanswered: Export to Word in landscape

    I have an MsAccess database and bij clicking a command button I run the following code:

    DoCmd.OutputTo acOutputTable, "tbl_issues", acFormatRTF, "C:\txtfiles\april.rtf", True

    From a table named "tbl_issues" I export the data in RTF format to the Word document "C:\txtfiles\april.rtf"

    Until here no problems.....

    If I open the Word document it is in portrait view so a lot of the data is not visible. If I change the settings to landscape everything is fine.

    But I cannot expect that the users will have to change the page settings every time. I just want this file to be opened in landscape view.

    I tried to change the settings of the file "C:\txtfiles\april.rtf" but every time after generating a new version it is portrait again.

    What parameter can I add to my code to make the Word document open in landscape view? Thanks in advance!

  2. #2
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    Create a form [or Report] (even use the wizard) that simply contains all the fields. Set the Page Setup for the Form [or Report] to what you need and output the form instead of the table.

    Have fun

  3. #3
    Join Date
    Jul 2004
    Posts
    24

    still not happy

    That could be an option, the problem however will be that in a report you cannot adjust data, in Word you can.

  4. #4
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    That could be an option, the problem however will be that in a report you cannot adjust data, in Word you can.
    True, but you can output the report to Word.

  5. #5
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Smile

    I just gave it a try and it works ok, but what I did was with the report open I clicked on the OfficeLinks button in A2K and then Publish with Word. It automatically sent it to Word and in Landscape view just like my report, only it uses plain old bland text. Just thought I'd let you know.

    see if it works,
    Bud

  6. #6
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    you can do it programatically using the same command as your original post in this thread, simply replace acOutputTable with acOutputReport and substitute the report's name.

    As for the formatting, that's about all you get. Output to Word does not bring lines, boxes, etc. from Access.

    If you are looking for an editable "table" format, consider seting up a Form instead of a Report and output to Excel instead of Word.

    The Report will output to Excel, but then Excel makes a best guess as to the data type of each field based on the data. A company that I consult for uses 9 digit Part ID's that sometimes begin with 0. When outputing a Report to Excel, it will always convert the values to numbers and therefore drop the leading zero. When outputing a Form to Excel, the format of the control is honored in Excel, the fields output in the same order as the tab order and the column titles match the control names.

    So, Report to Word and Form to Excel.

    Have fun

  7. #7
    Join Date
    Jul 2004
    Posts
    24

    Eureka

    Runs like a train! Thanks all very much.

Posting Permissions

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