Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Save file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Daren White - 07 Mar 2008 19:55 GMT
I have a template which has a sendforreview button attached. I need to save
the document before I can use the sendforreview command. Is there any way I
can use the saveas command and have it saved as doc1 then doc 2 the next time
it is used then doc3 and so on?
Helmut Weber - 08 Mar 2008 01:26 GMT
Hi Daren,

something along these lines:

Sub MyFileSaveAs()
Dim sNam As String
Dim lTmp As Long
sNam = ActiveDocument.FullName
sNam = Left(sNam, Len(sNam) - 4) ' not Word 2007
If Not IsNumeric(Right(sNam, 3)) Then
  sNam = sNam & "-000" & ".doc"
  ActiveDocument.SaveAs sNam
Else
  lTmp = CLng(Right(sNam, 3))
  lTmp = lTmp + 1
  sNam = Left(sNam, Len(sNam) - 4)
  sNam = sNam & Format(lTmp, "-000")
  sNam = sNam & ".doc"
  ActiveDocument.SaveAs sNam
End If

End Sub

--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP
Daren White - 08 Mar 2008 16:19 GMT
Thanks works a treat

> Hi Daren,
>
[quoted text clipped - 26 lines]
>
> Vista Small Business, Office XP
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.