Notice: Undefined offset: 2 in /home2/icentarb/public_html/icentar/classes/class.permissions.php on line 735
Public Sub ExportReportToWord()
Dim wdApp As Object
Dim wdDoc As Object
Dim rtfPath As String
Dim docxPath As String
rtfPath = "C:\Ugovori\Ugovor.rtf"
docxPath = "C:\Ugovori\Ugovor.docx"
' Exportuj Access report kao RTF
DoCmd.OutputTo acOutputReport, "rptUgovor", acFormatRTF, rtfPath, False
' Otvori u Wordu i sacuvaj kao DOCX
Set wdApp = CreateObject("Word.Application")
Set wdDoc = wdApp.Documents.Open(rtfPath)
wdDoc.SaveAs2 docxPath, FileFormat:=16 ' 16 = wdFormatDocumentDefault (doc