Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    ASKER, Norway
    Posts
    277
    Thanks
    6
    Thanked 0 Times in 0 Posts

    File Conversion dialog don't show (WindXP Word 2003)

    Hi,

    I have seen the thread starting with Post 231708, but my problem is different:

    I'm opening a file with no extension, its probably a txt file. The "Tools/Optiond/General/Conferm Conversion at open" is not checked. (It probably doesn't matter whether it is or not.)

    When I use SaveAs and gives it a filename as a txt document another dialog box opens, called File Conversion. It contains a warning of loosing formating and an Option to Insert Line breaks ending with CR/LF.

    This is actually what I want to happen, but:

    In a global template I intercept the SaveAs with a procedure:

    Public Sub FileSaveAs()
    Dim response As Variant
    Dim Prompt As String, Heading As String
    Dim Msg

    With Application.Dialogs(wdDialogFileSaveAs)
    .Name = "TypeNewName#"
    ' ActiveDocument.Saved = True
    response = .Show
    If response = 0 Then
    Exit Sub
    End If


    On Error Resume Next
    CUSTOMPROP = ActiveDocument.CustomDocumentProperties("NoMacroTe mplate")

    If Err.Number <> 0 Then
    Exit Sub
    End If
    Err.Clear
    End With
    etc.

    When the file has been saved as MyFile.txt the File Conversion dialog box does not open and I do not get the posibility to choose the Option to Insert Line breaks ending with CR/LF, which I want.

    Anyone who can tel me why this happen and may how to get the dialog box to open?

    Thanks!

    Regards
    Bj

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: File Conversion dialog don't show (WindXP Word 2003)

    Save difference in behavior in Word 2002 (XP):

    Sub SaveAsDialog()
    Dialogs(wdDialogFileSaveAs).Show
    End Sub

    Suggests that the code behind the VBA dialog and the Word command are no longer in sync, perhaps for reasons of backwards compatibility of the VBA dialog? But simply executing the Save As commandbar control doesn't pop up the second box, either:

    Sub SaveAsCommand()
    CommandBars.FindControl(ID:=748).Execute
    End Sub

    Oh wait, we have global replacement macros already, so I'm not sure about this one.

    Difficult problem, and I have to get offline now...

  3. #3
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    ASKER, Norway
    Posts
    277
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Re: File Conversion dialog don't show (WindXP Word 2003)

    Hi,
    and thanks so far I'll try it.

    Regards
    Bj

  4. #4
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    ASKER, Norway
    Posts
    277
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Re: File Conversion dialog don't show (WindXP Word 2003)

    Hi,

    The first works, I use the same in the with... procedure and the second one generates an error.

    It looks to me that when intercepting the FileSaveAs command the File Conversion dialog will not be initialized. For some reason Word does not recognize it as a txt file in order to insert CR/LF(?)

    Don't know what more to try, its too late in the evening.


    Regards
    Bj

Posting Permissions

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