Prikazi cijelu temu 21.05.2025 22:17
Branestan Van mreze
Clan
Registrovan od:07.05.2012
Lokacija:Doboj


Predmet:Re:Access izvjestaj u word-u ili eksport podataka u word obrazac
Uz drugu funkciju dodao sam ovo, da mi odmah otvori dokument:

Private Sub Command1_Click()

Dim LWordDoc As String
Dim oApp As Object

'Path to the word document
LWordDoc = "C:\Ugovori\Ugovor.docx"

If Dir(LWordDoc) = "" Then
MsgBox "Document not found."

Else
'Create an instance of MS Word
Set oApp = CreateObject(Class:="Word.Application")
oApp.Visible = True

'Open the Document
oApp.Documents.Open filename:=LWordDoc
End If

End Sub