+ Reply to Thread
Results 1 to 3 of 3

Disable AutoMacros in Word Doc and delete all text files

  1. #1
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,417

    Post Disable AutoMacros in Word Doc and delete all text files

    Hi everyone,

    I have been putting together a macro that opens a word document --> saves only data for forms as text file. I have two issues that I can't seem to understand:

    1) The following code works fine when I select all word docs in a folder using the msoFileDialogFolderPicker but not when I choose only one file using GetOpenFilename.

    Please Login or Register  to view this content.
    The error states that the Word document is protected, but this is the case in both cases above. Its the same file so why it is giving me an error only when I use the GetOpenFilename method and is there a way to circumvent this issue.


    2) I want to delete all the created text files that were generated during the process but my maco won't work.

    Please Login or Register  to view this content.
    Does anyone see what is wrong with it

    Thanks in advance.

    abousetta
    Last edited by abousetta; 06-27-2010 at 03:04 AM.

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,647

    Re: Disable AutoMacros in Word Doc and delete all text files

    This is sufficient
    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,417

    Re: Disable AutoMacros in Word Doc and delete all text files

    Thanks snb. This does the trick.

    As for the file protection, I have added code to unprotect the file regardless of whether an error message appears or not. This seems to be working for now, but I have to test it further.

    abousetta

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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