Hi
I'm trying to open a pdf document via vbscript. This is what I have got so far:
The result of the Replace-function is:
"""C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe"" /A ""page=2"" ""C:\Doc.pdf"""
This string is necessary to open a PDF on specific page via vbscript.
The problem is, the command
just opens the Windows Explorer... but no pdf. If I write straight
then it works... but I want the initial page of the pdf to be read from a variable (here: "Page"), not as a constant.
I also tried a concatenation:
but neither this works, no matter how you look at it...
I'd appreciate any help
I'm trying to open a pdf document via vbscript. This is what I have got so far:
Code:
Dim wshShell, Page, temp
Page = 2
temp = Replace("""""""C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe"""" /A """"page=""""
""""C:\Doc.pdf""""""","page=","page="&Page)
Set wshShell = CreateObject("WSCript.shell")
wshShell.Run temp
Set wshShell = Nothing
The result of the Replace-function is:
"""C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe"" /A ""page=2"" ""C:\Doc.pdf"""
This string is necessary to open a PDF on specific page via vbscript.
The problem is, the command
Code:
wshShell.Run temp
Code:
wshShell.Run """C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe"" /A ""page=2"" ""C:\Doc.pdf"""
I also tried a concatenation:
Code:
wshShell.Run """C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe"" /A ""page="" & Page & ""C:\Doc.pdf"""
I'd appreciate any help