Results 1 to 10 of 22

Thread: String text in Word html. Passing info between Word and Excel

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #10
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,319
    Rep Power
    10

    Saving Word doc containing images, as .htm produces a folder with images in it

    Saving Word doc containing images, as .htm produces a folder with images in it
    So we have established that saving Word doc containing images, as .htm produces a folder with images in it , and we can even find a bit of Microsoft documentation about it

    As Microsoft have “wired it” to do this, we might find some useful information in the arguments Iin the Save As code line

    This is the OPs original
    ActiveDocument.SaveAs strPath & "" & strDocumentName, wdFormatHTML, , , , , True
    In detail:
    strPath & "" & strDocumentName,
    wdFormatHTML,
    ,
    ,
    ,
    ,
    True


    Here for comparison what the macro recorder typically gave me:
    ActiveDocument.SaveAs FileName:="docHTML2.htm", FileFormat:=wdFormatHTML, LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False
    In detail:
    FileName:="docHTML2.htm",
    FileFormat:=wdFormatHTML,
    LockComments:= False,
    Password:="",
    AddToRecentFiles:= True,
    WritePassword:="",
    ReadOnlyRecommended:= False,
    EmbedTrueTypeFonts:= False,
    SaveNativePictureFormat:= False,
    SaveFormsData:= False,
    SaveAsAOCELetter:=False


    Unnamed arguments, as used by the OP, must go in correct order. Named argumenzts, as I am using, do not have to go in order, but as far as I am aware the macro recorder does
    _ give them in order, and
    _ usually gives a lot of the arguments in their default values.
    So we can re write the equivalent named argument version of the OPs code line thus:
    FileName:= strPath & "" & strDocumentName,
    FileFormat:= wdFormatHTML,
    LockComments:=False,
    Password:="",
    AddToRecentFiles:=True,
    WritePassword:="",
    ReadOnlyRecommended:= True



    Conclusion here is that we are more or less doiung the same thing, - a recommendation for read only likely just causes some extra warnings when the file is opened. That is of little concern to our issues
    Last edited by DocAElstein; 09-15-2021 at 02:16 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    _...KILL A MODERATOR!!

Similar Threads

  1. Replies: 1
    Last Post: 04-02-2019, 03:04 PM
  2. Export data (text) Excel to Ms Word Format
    By muhammad susanto in forum Excel Help
    Replies: 0
    Last Post: 10-06-2017, 09:36 AM
  3. Replies: 7
    Last Post: 08-24-2015, 10:58 PM
  4. VBA How to pass formatted text from Excel to MS Word
    By johnweber in forum Excel Help
    Replies: 2
    Last Post: 03-01-2015, 08:41 PM
  5. Replies: 1
    Last Post: 10-16-2012, 01:53 PM

Posting Permissions

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