A
avkokin
Hello.
There is the macro for saving the document with name from bookmark
(thank's G.Mayor and D.Robbins).
Sub FileSave()
Dim fName As String
On Error Resume Next
If Len(ActiveDocument.Path) = 0 Then
fName = ActiveDocument.Bookmarks("Bookmark1").Range
If Len(fName) = 0 Then
MsgBox "File naming bookmark is empty or missing." & vbCr & _
"Document has not been saved"
Exit Sub
End If
ActiveDocument.SaveAs fName & ".doc"
Else
ActiveDocument.Save
End If
End Sub
I need to show dialogue Sava As that user can select any folder for
saving document. But the field "Name of File" should has as name my
bookmark. Is it probably? How? I did so temporary:
Sub FileSave()
Dim fName As String
Dim PathName As String
PathName = "c:\"
On Error Resume Next
If Len(ActiveDocument.Path) = 0 Then
fName = ActiveDocument.Bookmarks("bookmark1").Range
If Len(fName) = 0 Then
MsgBox "File naming bookmark is empty or missing." & vbCr & _
"Document has not been saved"
Exit Sub
End If
ActiveDocument.SaveAs PathName & fName & ".doc"
Else
ActiveDocument.Save
End If
End Sub
There is the macro for saving the document with name from bookmark
(thank's G.Mayor and D.Robbins).
Sub FileSave()
Dim fName As String
On Error Resume Next
If Len(ActiveDocument.Path) = 0 Then
fName = ActiveDocument.Bookmarks("Bookmark1").Range
If Len(fName) = 0 Then
MsgBox "File naming bookmark is empty or missing." & vbCr & _
"Document has not been saved"
Exit Sub
End If
ActiveDocument.SaveAs fName & ".doc"
Else
ActiveDocument.Save
End If
End Sub
I need to show dialogue Sava As that user can select any folder for
saving document. But the field "Name of File" should has as name my
bookmark. Is it probably? How? I did so temporary:
Sub FileSave()
Dim fName As String
Dim PathName As String
PathName = "c:\"
On Error Resume Next
If Len(ActiveDocument.Path) = 0 Then
fName = ActiveDocument.Bookmarks("bookmark1").Range
If Len(fName) = 0 Then
MsgBox "File naming bookmark is empty or missing." & vbCr & _
"Document has not been saved"
Exit Sub
End If
ActiveDocument.SaveAs PathName & fName & ".doc"
Else
ActiveDocument.Save
End If
End Sub