Saving documents as html using a Script

After the data has been loaded into the Universe we are running a script that will open, refresh and save the documents as html. I have tried using the ExportAsHtml Function and receive syntax errors. The SaveAs class defaults to .rep. Does anyone have a script with an example of saving a document as html? Thanks


Listserv Archives (BOB member since 2002-06-25)

 This script should do what you want...

 Jason Beard
 ------------------------------------------------------------------
     Dim doc as BODocument
     set doc = Application.Documents.Open("Order Register")
     doc.Refresh
     doc.ExportSheetsAsHtml "d:\Orders.htm", "Region Territory", TRUE,
     TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, 1
 ------------------------------------------------------------------

 After the data has been loaded into the Universe we are running a
 script that will open, refresh and save the documents as html. I have
 tried using the ExportAsHtml Function and receive syntax errors. The
 SaveAs class defaults to .rep. Does anyone have a script with an
 example of saving a document as html? Thanks

Listserv Archives (BOB member since 2002-06-25)

Linda,

Here’s something I got from a post on the listserver from a while
back…hope this helps.


This is a script which I use and describes each formatting option.

Example:

This script sends the entire document to a server as HTML

    dim     BO_Doc as BODocument
    Set BO_Doc = ActiveDocument
    call BO_Doc.ExportSheetsAsHtml("\\MyServer\My_Share\"+ BO_Doc.Name,

BO_Doc,1,1,1,1,1,1,1,0,0,1)

The options that are set are:

FileName = BO_Doc.Name
SheetsName = BO_Doc (i.e. ActiveDocument, all sheets)
Graphs = 1 (Yes)
Borders = 1 (Yes)
Background = 1 (Yes)
Foreground = 1 (Yes)
Font = 1 (Yes)
FreeForm = 1 (Yes)
Frames = 1 (Yes)
RefreshTime = 0 (No…don’t autorefresh, therefore zero
seconds)
BusObjDoc = 0 (No… I don’t want the BO Document to be
downloaded from the web)
HtmlLayout = 1 (optional, if omitted assumes the default)
HtmlLayout to specify the type of page layout:
0 = All in one page. This is the default.
1 = Show each section of the report on a separate page.
A table of contents column appears on the left of the
page.
2 = Both. A table of contents column appears on the left of the
page.



Listserv Archives (BOB member since 2002-06-25)

Hello, I was wondering whether anybody could help me! We have recently upgraded our 5.18 to 6.5.3. And since then, our ExportSheetsAsHtml seems to have gone bizarre! Basically, instead of inserting an “_”, its seems to be inserting a “+”. I have no idea why, the code hasn’t changed, all I can think of is the parameters have… Heres our current code…

Call doc.ExportSheetsAsHtml(HTML_FILE, blank_file, 1, 1, 1, 1, 1, 1, 0, , 0, 2)

Any help or advice? :hb:


dopey (BOB member since 2006-08-23)