Results 1 to 2 of 2
  1. #1
    kaylong is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2015
    Posts
    1

    macro to save a file as PDF, rename and move

    Hallo everyone,
    im a beginner with VBA in Access.
    i hope that someone can help me with this code. im working with MS Office 2010 and i have Database with more of 25 Tabels and quires.
    what i need to do is:
    -creat a macro that export reports as pdf-file with the name"BUMS_Projectnr_Project_comment.pdf" (asking before export the file...filedialog??) in C:\desktop
    - if that file already exist move the old one to C:\desktop\ISD_Test with the name "BUMS_Projectnr_Project_comment+00.pdf" and if exist....+01..+02 again and again(the new one take the old name and old path)

    Thanks

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    can you just use a timestamp?

    Code:
    dim vFile
    
    vFile = "c:\folder\file" & format(Date(),"yymmdd-hhnn") & ".pdf"
    docmd.OutputTo acOutputReport ,"rptReport",acformatpdf,vFile

Please reply to this thread with any new information or opinions.

Similar Threads

  1. rename a PDF File
    By sdel_nevo in forum Programming
    Replies: 3
    Last Post: 08-21-2013, 12:11 PM
  2. using macro to rename column values in Access
    By coolbear91 in forum Programming
    Replies: 1
    Last Post: 02-20-2013, 11:10 PM
  3. Replies: 4
    Last Post: 10-30-2012, 02:54 PM
  4. Replies: 4
    Last Post: 11-05-2010, 04:56 AM
  5. Have access rename a .txt file and move it
    By dh010010 in forum Programming
    Replies: 5
    Last Post: 07-22-2010, 10:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums