"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
I assume this will work then:
Sub LoopFiles() Dim strDir As String, strFileName As String strDir = "G:\Branham SW455S 3 Jun11\" strFileName = Dir(strDir & "*.doc") Do While strFileName <> "" Documents.Open strDir & strFileName strFileName = Left(strFileName, Len(strFileName) - 4) & ".txt" ActiveDocument.SaveAs FileName:=strDir & strFileName, fileformat:=wdFormatText ActiveDocument.Close strFileName = Dir Loop End Sub
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
its still not workinganything that you can think of that would make it not work right for me
@Domski
Please post your code here (on my system: impeccable)
I made a slight modification:
sub snb() c00="E:\OF\" c01="doc" c02=dir(c00 & "*." & c01) do until c01="" with getobject(c00 & c02) c03=c03 & c02 c04=c04 & "~|" & .content .activate .close 0 end with c02=dir loop if c03<>"" then sn=split(replace(c03,".doc",".txt|"),"|") sp=split(mid(c04,3),"~|") for j=0 to ubound(sn)-1 open c00 & sn(j) for output as #1 print #1,sp(j) close next end if End Sub
i figured out the problem and fixed it thank you all for your help
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks