Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Apr 2012
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts

    bypassing user confirmation in Word 2010 "Save as Text with Layout" macro

    I'm trying to automate a Word 2010 "Save as" task using the legacy "Text with Layout" converter (http://www.gmayor.com/downloads.htm). I recorded the steps and got this:

    Code:
        ChangeFileOpenDirectory _
            "C:\test\"
        ActiveDocument.SaveAs2 FileName:="ReleaseNotes_text.ans", FileFormat:=101, _
             LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword _
            :="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
            SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
            False, CompatibilityMode:=0
    End Sub
    It works, but pauses for user input on a Microsoft Word dialog, "This file needs to be saved using the Text with Layout converter. If you are not the author of this file or if the file is not from a trusted source, using this converter may pose a security risk. Click Yes to save this file only if you are sure it is from a trusted source."

    Is there some way to tweak the macro to bypass that dialog?

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Robert,

    Welcome to the lounge as a new poster!

    Try placing this before your .SaveAs command.

    Application.DisplayAlerts = False

    Should solve the problem.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. #3
    New Lounger
    Join Date
    Apr 2012
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by RetiredGeek View Post
    Application.DisplayAlerts = False
    Thanks, that's exactly what I was looking for.

Posting Permissions

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