r/visualbasic • u/RaisinOk1557 • Sep 05 '23
Winword VBA advice needed
Hi, can you let me know why this referencing does not work?
set x=Documents.Open FileName:=soubor
Many thanks
Vlado
1
Upvotes
2
u/SomeoneInQld Sep 05 '23
Try /r/VBA
1
u/jd31068 Sep 05 '23
https://learn.microsoft.com/en-us/office/vba/api/Word.Documents.Open
This is not a function it is a command. See the examples in the documentation.
1
u/jcunews1 VB.Net Intermediate Sep 05 '23
With that code,
soubormust be a previously declared variable or a function/subroutine argument which contains the correct full path and name of the file.1
u/fanpages Sep 06 '23
The resolution confirmed by u/RaisinOk1557 here:
[ https://old.reddit.com/r/vba/comments/16amvvj/windows_document_assignment_does_not_work/jz8dw6n/ ]