View Single Post
 
Old 07-04-2014, 04:27 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,381
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

OK, Given that you say the components are contained within the bookmarks, the code to give a SaveAs prompt with those components for the name would be something along the lines of:
Code:
Sub Demo()
Dim StrNm As String
With ActiveDocument
StrNm = .Bookmarks("docnumber").Range.Text & _
  .Bookmarks("doctype ").Range.Text & _
  .Bookmarks("sitename").Range.Text & _
  .Bookmarks("personname").Range.Text
End With
With Application.Dialogs(wdDialogFileSaveAs)
  .Name = StrNm
  .Show
End With
End Sub
Note that there's no error-checking for characters that aren't valid for a filename. A small amount extra code would be needed for that.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote