![]() |
|
#1
|
||||
|
||||
![]()
Hi Dom,
The problem is that you're referring to the bookmark, not its contents. Try something like: Code:
Sub SalvaNonConformita() Dim StrDoc As String, StrPath As String, StrBkMk As String StrPath = "C:\Documenti\" With ActiveDocument StrDoc = Split(.Name, ".")(0) StrBkMk = .Bookmarks("CodAnom").Range.Text If StrDoc = .Name Then StrDoc = StrPath & "NonConformita_" & StrBkMk & ".doc" .SaveAs FileName:=StrDoc, FileFormat:=wdFormatDocument, AddToRecentFiles:=True End If .Close End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Disable "do you also want to save changes to the document template?" harassalog. | wornways | Word | 30 | 06-04-2016 02:32 PM |
![]() |
Jamal NUMAN | Word | 2 | 07-03-2011 03:11 AM |
![]() |
webharvest | Word VBA | 1 | 06-29-2011 04:56 PM |
How to fix "create bookmarks using headings" as default when saving to PDF using Word | ghumdinger | Word | 0 | 05-05-2011 02:11 AM |
![]() |
rnstewart | Excel | 2 | 12-28-2005 04:30 PM |