none
Publishobjects creates unwanted folders

    Question

  • I am using the PublishObects.add function to create an html file.  The file is created but and it also creates a folder for each html file.  The folder contains with style sheets etc.  I do not want these folders.  What parameter should be omitted so these folders are not created.
    • Edited by opetal Tuesday, March 27, 2012 5:04 PM
    Tuesday, March 27, 2012 4:24 PM

Answers

  • I copied the code below from Ron DeBruins webpage.  He uses PublishObjects to create flat HTML files and then attaches these files to email.  I hope this helps.

    http://msdn.microsoft.com/en-us/library/ff519602(office.11).aspx

     With TempWB.PublishObjects.Add( _
             SourceType:=xlSourceRange, _
             Filename:=TempFile, _
             Sheet:=TempWB.Sheets(1).Name, _
             Source:=TempWB.Sheets(1).UsedRange.Address, _
             HtmlType:=xlHtmlStatic)
            .Publish (True)
        End With


    jdweng

    Tuesday, March 27, 2012 5:16 PM