![]() |
#1
|
|||
|
|||
![]()
Goodmorning, i need create a macro VBA : Save as
my problem is insert in file name string a bookmark present in my active document. I make so: Code:
Sub SalvaNonConformita() ChangeFileOpenDirectory "C:\Documenti\" myDocname = ActiveDocument.Name ActiveDocument.Bookmarks("CodAnom").Select pos = InStr(myDocname, ".") If pos > 0 Then myDocname = Left(myDocname, pos - 1) myDocname = "NonConformita_" & MyBookmark & ".doc" ActiveDocument.SaveAs FileName:=myDocname, FileFormat:=wdFormatDocument, _ LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword:="", _ ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _ SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False End If 'ActiveDocument.Close ChangeFileOpenDirectory "C:\Documenti\" End Sub Please help me ![]() Last edited by macropod; 10-31-2011 at 02:04 AM. Reason: Added code tags |
|
![]() |
||||
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 |