[quote=127214:@Eugene Dakin]Hello Damien,
The following examples worked on my machine with Windows 8.1, Microsoft Office 2013 Word, and Xojo 2014 r2.1. The file folder “C:\Test” was created before the program was executed.
Here is an example of how to save the Microsoft Word 2013 file as a PDF:
[code] Dim word as new WordApplication
word.Documents.Add
word.Visible = True
word.Selection.TypeText “This is saved as a PDF file from Word 2013. Lorem ipsum dolor sit amet.”
word.ActiveDocument.ExportAsFixedFormat(“C:\Test\TestFile.pdf”,17)
Exception err as NilObjectException
MsgBox Err.Message[/code]
…And here is an example of how to save a Microsoft Word 2013 file as a htm:
[code] Dim word as new WordApplication
word.Documents.Add
word.Visible = True
word.Selection.TypeText “This is saved as a HTM file from Word 2013. Lorem ipsum dolor sit amet.”
word.ActiveDocument.SaveAs2(“C:\test\HTMLDoc.htm”, 8)
Exception err as NilObjectException
MsgBox Err.Message[/code]
Does this work on your machine?[/quote]
Hi Eugene
I discovered the trick of using the number 17 instead of trying to use the enumeration for pdf format. Saving as html works using office.wdFormatHTML. or you can use the value 8 as you have it.
What I am expecting is that options such as “SaveAs2” or “ExportasFixedFormat” will appear in the popup that is available as you are typing in the statement. This popup list does not appear to be complete. For example I only get Save or SaveAs offered in the popup. When I type in word.ActiveDocument.ExportAsFixedFormat(c,17) where c is my folderitem this does work but I get no help from Xojo in selecting the ExportAsFixedFormat method.
I’m using Win 7, MS Office 2013 Word and Xojo 2013 r2. Thanks for your help.