+ Reply to Thread
Results 1 to 5 of 5

Word - Sharing String Between Subroutines for Kill Statement Directory

  1. #1
    Registered User
    Join Date
    10-15-2018
    Location
    Canberra Australia
    MS-Off Ver
    2010
    Posts
    5

    Word - Sharing String Between Subroutines for Kill Statement Directory

    Hi Guys, Part of my job involves combining dozens of word docs and pdf's into a single PDF. As PDF files combines waaay faster within Adobe pro than word docs I am using a macro to convert all word docs within a folder to pdf (it does this quickly) I then go in afterwards and have to manually delete the word docs... you can see where im going with this.

    I'm very new to this and have Frankenstein'ed code from various places in order to have it delete the word docs after the conversion and would love some advice.

    TL:DR, Requesting your beautiful assistance in deleting only .doc files within a folder using a string from the previous sub as the directory location. My efforts so far pasted below


    Please Login or Register  to view this content.
    Last edited by Leith Ross; 10-16-2018 at 11:24 PM. Reason: Added Code Tags

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Word - Sharing String Between Subroutines for Kill Statement Directory

    Why not delete the files as you go along?
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    10-15-2018
    Location
    Canberra Australia
    MS-Off Ver
    2010
    Posts
    5

    Re: Word - Sharing String Between Subroutines for Kill Statement Directory

    Hi Norie, Thanks, Not sure whats up with my replies not showing up, I tried incorporating your code it and it deletes the PDFs Instead. Likely i have implemented it wrong though

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Word - Sharing String Between Subroutines for Kill Statement Directory

    No, it's my fault - I didn't notice that you are using strDocName for the name to save the PDF with.

    Try this instead.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-15-2018
    Location
    Canberra Australia
    MS-Off Ver
    2010
    Posts
    5

    Re: Word - Sharing String Between Subroutines for Kill Statement Directory

    Not exactly sure what you did but I cannot thankyou enough. It works perfectly now.

    Bless

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Grab last word from string and then delete word from original string.
    By mtilbury in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-14-2015, 04:14 AM
  2. vba to search for a word in files in a directory
    By NickyC in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-19-2015, 01:42 AM
  3. [SOLVED] can't debug some subroutines in my project, locked subroutines
    By florin_excel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-28-2012, 01:16 PM
  4. Parse Directory into String field
    By AppSupportKarl in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-06-2012, 12:40 PM
  5. Find current directory - Optional string
    By Jacques Grobler in forum Excel General
    Replies: 3
    Last Post: 10-03-2011, 01:31 AM
  6. [SOLVED] Kill Command - Using directory from workbook cell
    By superfurry in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-22-2010, 02:12 PM
  7. Sharing variables between Excel and Word
    By Berny in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-31-2006, 09:35 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1