Consulting

Results 1 to 2 of 2

Thread: Print Documents Using File Path

  1. #1
    VBAX Regular
    Joined
    Apr 2017
    Posts
    66
    Location

    Print Documents Using File Path

    I want to print .pdf documents using their file paths, code below is not working. The code runs with no errors, but nothing happens.

    Sub PrintDocs()
    
    strFilePath = "C:\Users\....\Example.pdf"
                    
    CreateObject("Shell.Application").Namespace(0).ParseName(strFilePath).InvokeVerb ("Print")  'Also tried using ("&Print")
    
    End Sub
    Can anyone assist?

  2. #2
    VBAX Expert Logit's Avatar
    Joined
    Sep 2016
    Posts
    613
    Location
    .
    Have you tried supplying the entire path for strFilePath ?

    Ex:

    strFilePath = "C:\Users\YourComputerName\Documents\Example.pdf"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •