Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 28 JUL 2022 06:30:56PM Barry Stevens wrote:

using OleCreateInstance("Word.Application")

Programmatically, I want to convert a .htm file to .docx and then back to .htm (this will let me get outlook email signatures in a format to enable me to convert any images to base64) - This works using msword app saveas.

What is the actual coding to do that.


At 28 JUL 2022 06:45PM Donald Bakke wrote:

using OleCreateInstance("Word.Application")

Programmatically, I want to convert a .htm file to .docx and then back to .htm (this will let me get outlook email signatures in a format to enable me to convert any images to base64) - This works using msword app saveas.

What is the actual coding to do that.

Are you familiar with the technique of creating a VB macro and using the commands it generates to write your OI code?

Don Bakke

SRP Computer Solutions, Inc.


At 28 JUL 2022 07:39PM Barry Stevens wrote:

using OleCreateInstance("Word.Application")

Programmatically, I want to convert a .htm file to .docx and then back to .htm (this will let me get outlook email signatures in a format to enable me to convert any images to base64) - This works using msword app saveas.

What is the actual coding to do that.

Are you familiar with the technique of creating a VB macro and using the commands it generates to write your OI code?

Don Bakke

SRP Computer Solutions, Inc.

Well, yes and no.

I can create the macro, but not quite interpret it.

Here I get:

ActiveDocument.SaveAs2 FileName:="PBCsig.docx", FileFormat:= _

        wdFormatXMLDocument, LockComments:=False, Password:="", AddToRecentFiles _

        :=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts _

        :=False, SaveNativePictureFormat:=False, SaveFormsData:=False, _

        SaveAsAOCELetter:=False, CompatibilityMode:=15

    ActiveDocument.SaveAs2 FileName:="PBCsig.htm", FileFormat:= _

        wdFormatFilteredHTML, LockComments:=False, Password:="", AddToRecentFiles _

        :=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts _

        :=False, SaveNativePictureFormat:=False, SaveFormsData:=False, _

        SaveAsAOCELetter:=False, CompatibilityMode:=0

But, I assume wdFormatXMLDocument and wdFormatFilteredHTML are codes?


At 28 JUL 2022 07:44PM Barry Stevens wrote:

using OleCreateInstance("Word.Application")

Programmatically, I want to convert a .htm file to .docx and then back to .htm (this will let me get outlook email signatures in a format to enable me to convert any images to base64) - This works using msword app saveas.

What is the actual coding to do that.

Are you familiar with the technique of creating a VB macro and using the commands it generates to write your OI code?

Don Bakke

SRP Computer Solutions, Inc.

Ah, just googled and found the codes.

I will attempt as I do have existing code for word merge, so, I will pick the eyes out of that, maybe!

Unless of course you have existing code :smile:


At 28 JUL 2022 07:50PM Donald Bakke wrote:

using OleCreateInstance("Word.Application")

Programmatically, I want to convert a .htm file to .docx and then back to .htm (this will let me get outlook email signatures in a format to enable me to convert any images to base64) - This works using msword app saveas.

What is the actual coding to do that.

Are you familiar with the technique of creating a VB macro and using the commands it generates to write your OI code?

Don Bakke

SRP Computer Solutions, Inc.

Ah, just googled and found the codes.

I will attempt as I do have existing code for word merge, so, I will pick the eyes out of that, maybe!

Unless of course you have existing code :smile:

No existing code for what you are doing, but I've gotten familiar with writing my own code using this technique. I start with the Application object model documentation and work my way forward.

Don Bakke

SRP Computer Solutions, Inc.


At 29 JUL 2022 03:05AM Barry Stevens wrote:

using OleCreateInstance("Word.Application")

Programmatically, I want to convert a .htm file to .docx and then back to .htm (this will let me get outlook email signatures in a format to enable me to convert any images to base64) - This works using msword app saveas.

What is the actual coding to do that.

Are you familiar with the technique of creating a VB macro and using the commands it generates to write your OI code?

Don Bakke

SRP Computer Solutions, Inc.

Ah, just googled and found the codes.

I will attempt as I do have existing code for word merge, so, I will pick the eyes out of that, maybe!

Unless of course you have existing code :smile:

No existing code for what you are doing, but I've gotten familiar with writing my own code using this technique. I start with the Application object model documentation and work my way forward.

Don Bakke

SRP Computer Solutions, Inc.

Got it Working!!!

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/c086ee3cad5bfa4f9a88ba3f39e0ff58.txt
  • Last modified: 2024/01/04 20:57
  • by 127.0.0.1