• save as text file warning (2000)

    Author
    Topic
    #384281

    Each time I save a doc as a text file, Word gives a warning about converting. Is there any way to turn this off? (I see the option to turn on or off warning on OPEN for conversion.)

    THANKS!

    Viewing 1 reply thread
    Author
    Replies
    • #658769

      I’m assuming the warning relates to losing formatting, layout etc. I don’t know if there’s a way to turn it off, but in case you’re not aware, you’ll end up with a “document” containing only plain text if you do save it as .TXT.

      Alan

    • #659494

      I am aware of losing formatting – that’s why we are saving as text. (A user has to do this about 100 times a day, that’s why I’m trying to speed up the process). I’ve written a simple macro that saves the document as a txt file. It’s working fine, except the document on the screen doesn’t show up as a text file (with “plain” as the style and no formatting) unless I close and then open the file. (So it’s doing its job, it just doesn’t display the results with the active doc.) Is there a convert command that would convert the document on the screen? Or should I close the current document and reopen it? I’m not sure how I could close and then open the same document.

      Here’s what I have so far:

      Sub SaveAsTxt()
      ‘On Error GoTo EndSaveAsTxt
      If ActiveDocument.SaveFormat = 2 Then
      ActiveDocument.Save
      Else
      With Application.Dialogs(wdDialogFileSaveAs)
      .Format = wdFormatText
      .Show
      End With

      End If
      Endsaving:
      End Sub

      THANKS ALL!

      • #659518

        If you put Application.Display Alerts = wdAlertsMessageBox before and Application.DisplayAlerts = wdAlertsAll after your save code, this will “hide” the lose format dialog box.

        Here is the revised Else code:

        Application.DisplayAlerts = wdAlertsMessageBox
        With Application.Dialogs(wdDialogFileSaveAs)
        .Format = wdFormatText
        .Show
        End With
        Application.DisplayAlerts = wdAlertsAll

        This will still show the Overwrite dialog if the file already exists, but won’t show the “lose formatting” dialog.

        • #659738

          Bryan
          This helps part of the problem. I was hoping I could actually see the results of the conversion on the screen after the save as text.
          thanks,
          David

          • #659751

            How about creating a style that looks the way you want, maybe using courier new at a suitable point size, and then applying that style to all text in the document and clearing any manual formatting.

            Something lilke…

            ActiveDocument.Content.Style = “TextStyle”
            ActiveDocument.Content.ParagraphFormat.Reset
            ActiveDocument.Content.Font.Reset

            StuartR

          • #659782

            (Edited by carbonnb on 08-Mar-03 10:54. Forgot to add one important point)

            I think that you need to close and then reopen the file to see the results of the conversion.

            So to do that you need to get the filename after the file has been saved, close the document and then reopen

            Sub SaveAsTxt()
            ‘On Error GoTo EndSaveAsTxt
            Dim strFile As String

            If ActiveDocument.SaveFormat = 2 Then
            ActiveDocument.Save
            Else
            Application.DisplayAlerts = wdAlertsMessageBox
            With Application.Dialogs(wdDialogFileSaveAs)
            .Format = wdFormatText
            .Show
            strFile = .Name
            End With
            Application.DisplayAlerts = wdAlertsAll
            End If

            ActiveDocument.Close
            Documents.Open strFile

            Endsaving:
            End Sub

            Important point: You should have this code in a global template. If it is in the document that you are saving as plain text, then once the document closes, the code stops running, so it won’t re-open automatically.

      • #659578

        “(A user has to do this about 100 times a day, that’s why I’m trying to speed up the process). ”

        Why NOT get a GOOD Text Editor to do this work, and NOT use MS Word.

        DaveA I am so far behind, I think I am First
        Genealogy....confusing the dead and annoying the living

        • #659736

          The files come in from outside the firm in Word format, but then move to another system that doesn’t support Word documents.

    Viewing 1 reply thread
    Reply To: save as text file warning (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: