Cal Who replied to Cal Who
18-Dec-09 09:51 PM

My query us way too general.
Using VB.Net I can get the file names.
If the following is OK I will be able to open the file
Private WordApp As New Word.ApplicationClass()
' WordApp.Activate();
WordApp.Visible = True
Dim aDoc As Word.Document = WordApp.Documents.Open(fileName, missing,
[readOnly], missing, missing, missing, missing, missing, missing, missing,
missing, isVisible)
aDoc.Activate()
Below is a Macro that I recored to save the file as an HTML and as a PDF.
I have no idea how to procede.
Do I convert the VBA code to VB.Net and simply run it?
What is, for example, Documents.Open FileName
and
ActiveDocument.ExportAsFixedFormat
Can I look this up someplace?
Thanks
Sub TEST1()
'
' TEST1 Macro
' TEST
'
ChangeFileOpenDirectory "C:\Documents and Settings\Cal\Desktop\junk\"
Documents.Open FileName:="Prayer.docx", ConfirmConversions:=False, _
ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto,
XMLTransform:=""
ChangeFileOpenDirectory _
ActiveDocument.ExportAsFixedFormat OutputFileName:= _
7\Prayer.pdf" _
, ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False,
OptimizeFor:= _
wdExportOptimizeForOnScreen, Range:=wdExportAllDocument, From:=1,
To:=1, _
Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True,
_
CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True,
_
BitmapMissingFonts:=True, UseISO19005_1:=False
ChangeFileOpenDirectory _
ActiveDocument.SaveAs FileName:="Prayer.htm", FileFormat:= _
wdFormatFilteredHTML, LockComments:=False, Password:="",
AddToRecentFiles _
EmbedTrueTypeFonts _
SaveAsAOCELetter:=False
ActiveWindow.View.Type = wdWebView
ActiveDocument.Close
RecentFiles(2).Open
ShowVisualBasicEditor = True
End Sub