Re: VBA question for "save as" function by TRYoung
TRYoung
Fri Sep 01 14:47:01 CDT 2006
Disregard the question about replacing all the code. I ended up replacing it
all, and your code did everything I needed it to do and more.
Thank you so much; I really appreciate your time!
--
I''m just a simple man, trying to make my way in the universe...
"TR Young" wrote:
> Thank you, Helmut. Honestly, once I get to the point in my file where I save
> it as a .txt file, I am finished with it and it gets kicked out to another
> employee who manipulates it in Excel.
> Should I replace ALL my current VBA code as follows with the code that you
> supplied?
>
> Sub Save_As_txt()
> '
> ' Save_As_txt Macro
> ' Macro recorded 9/1/2006 by tyoung
> '
> ActiveDocument.SaveAs FileName:=".txt", FileFormat:= _
> wdFormatText, LockComments:=False, Password:="",
> AddToRecentFiles:=True, _
> WritePassword:="", ReadOnlyRecommended:=False,
> EmbedTrueTypeFonts:=False, _
> SaveNativePictureFormat:=False, SaveFormsData:=False,
> SaveAsAOCELetter:= _
> False, Encoding:=1252, InsertLineBreaks:=False,
> AllowSubstitutions:=False _
> , LineEnding:=wdCRLF
> End Sub
>
> --
> I''m just a simple man, trying to make my way in the universe...
>
>
> "Helmut Weber" wrote:
>
> > Hi,
> >
> > guessing, that you want to save a copy of the doc
> > you are working on as txt, and maybe want to continue
> > working with the document.
> >
> > Sub Test445()
> > Dim sTmp As String
> > With ActiveDocument
> > sTmp = .FullName
> > sTmp = Left(sTmp, Len(sTmp) - 3)
> > sTmp = sTmp + "txt"
> > .SaveAs sTmp, wdFormatText
> > ' there are several reasons for the next 3 lines
> > sTmp = Left(sTmp, Len(sTmp) - 3)
> > sTmp = sTmp + "doc"
> > .SaveAs sTmp, wdFormatDocument
> > End With
> > End Sub
> >
> > Note: second time you run the macro,
> > you overwrite the previously saved files.
> >
> > HTH
> >
> > --
> > Greetings from Bavaria, Germany
> >
> > Helmut Weber, MVP WordVBA
> >
> > Win XP, Office 2003
> > "red.sys" & Chr$(64) & "t-online.de"
> >
> >
> >