I am wanting to get the file directory of an already open file dialog box opened by internet explorer. I used the FindWindow() API to get the correct filedialog box. But my question is how to get the file directory from that dialogbox.
I know how to get it from one that was opened using the following.
Application.FileDialog(msoFileDialogFilePicker)
But not from one that is allready open.
Edit:
Would something like Dim FileDialog as New msoFileDialogFilePicker work? I'm not sure if thats the correct Syntax
Related
Hi I have tried in vain to get a pdf file to open from pdf files in the report server I have saved to a folder. I can create a link using the rs:Command=GetResourceContents when I open the file from report server and copy the URL but I need it to be dynamic so adding the table field name matchesing the pdf name, this opens the folder with all the docs but not open the actual PDF??
Anyone help with this please draining my brain for something I hope is simple.
I have tried this:
file://MyServer/ReportServer/Test/Docs/MyDoc.pdf
This comes back as file not found.
Also I tried action - URL again doesnt open the file just the main folder?
="https://MyServer/ReportServer/Test/="+Fields!Document_Name.Value
Would be good to nail this
thx
I'm not sure I understand what you mean when you talk about a table, but if you wanted a list of PDF's in a folder on SSRS and then wanted to click a link to open them you can do so like this.
Build a report which uses something like the following as the dataset query for a table.
select Path, Name, ItemID from catalog where path like '/My PDF Folder/%'
Then you can build a URL that will open the file directly, and place this expression in a new column in the table.
You have two main options...
="http://myServerName/reportserver?" & Fields!Path.Value & "&rs:Command=GetResourceContents"
or
="http://myServerName/reports/api/v1.0/CatalogItems(" & Fields!ItemID.Value & ")/Model.Resource/Content/$value"
I've not tested this so if there is an issue, let me know and I'll build something to test it against
I'm developing a solution based on Word and Access.
In an Access mask, the user click a command and a Word file is automacilly created and inserted in a BoundObjectFrame via the following command:
With OleDoc
.Class = "Word.Document"
.OLETypeAllowed = acOLELinked
.SourceDoc = strFullNameFile
.Action = acOLECreateLink
End With
Everything is fine if the file named strFullNameFile is in a normal folder on my computer. But if is in a subfolder inside my OneDrive folder in my computer, I get a
Run-time error 2737
Impossible to find file with OLE object linked...
Do you have any idea why?
Thanks, Lauro
You need to pass the path with subfolder too.
It's searching the file in main folder.
I'm using this string before a pathway to a local excel document:
ms-excel:ofe|u|
The filepath looks like something like this "Y:/My Files/Organization/This Folder/
When clicking on the rendered link, Excel launches but I get the "Sorry, can't find file" alert which displays the failed path, wherein each space and back-slash are replaced with %20
Am I using that aforementioned ms-excel string correctly?
Thanks!
ms-excel:ofe|u|file:///${batchPath}
The missing bit was file:/// along that string. With that, the locally saved filepaths launched without issue!
I want users to be able to put the Project folder on any location of their choice. If I use:
Application.FollowHyperlink ("C:\Program Files(x86)\Project\reference.pdf")
The pdf document launches only if the user put the Project folder in the Program Files(x86) folder. Is there a way for access to refer to the current path instead? I have tried the below code with no luck.
Private Sub referencefile_Click()
Application.FollowHyperlink (".\reference.pdf")
End Sub
I have tried:
Application.FollowHyperlink (CurrentProject.Path & "\reference.pdf"),
NewWindow:=True
This works well with txt files but not with pdf files. Any idea?
After a Quick Check and ensuring that my pdf file was not corrupted.
Application.FollowHyperlink (CurrentProject.Path & "\reference.pdf"), NewWindow:=True
The above code works fine as long as the pdf file exits in the same location as the front end. If you have ever thought of eliminating the security warning that access gives when you manually enter a hyperlink to a control button's properties, this code may be a good solution.
I want to display dynamically .pdf files like pictures in a report, it should look like this:
i already tried with webbrowser, but then it doesn't show up in the preview or when i print the report out...
I also tried a ole unbound object, also no success, here the code i had in the Report_Load event:
Dim vPath As String
vPath = GetNewestDocument(Me!artNr)
'Returns path for pdf file, about:blank if there is no file.
If vPath = "about:blank" Then
Me!PDFBrowser.visible = True
Me.PDFBrowser.SourceDoc = vbNullString
Else
With Me.PDFBrowser
.OLETypeAllowed = acOLELinked
.SourceDoc = vPath
.SizeMode = acOLESizeStretch
End With
End If
EDIT:
With "I want to display dynamically ..." i meant to change dynamically pdf's in the Report.
EDIT 2:
I just found out that the type of the OLEunbound object is embedded, but i think this one should be linked as i read in other Forums:
When i try to Change it gives error: "This property can not be changed because it is read-only"
You could get a licensed version of Adobe Acrobat (not Reader) and control it programmatically to capture the images you want.
Alternatively, you could use the VBA Shell Function to call a command-line PDF converter like 2Jpeg to programmatically (and dynamically if necessary) convert the PDF to an image (see this), or even "print" the PDF to an image file using the correct driver (see this).
Once you have an image file, you can easily load the created image to your Access form with VBA, perhaps with this.
Without further information (and answers to my previous questions) I can't offer more suggestions at this point but I hope that helps!