Results 1 to 2 of 2
2008-08-06, 02:42 #1
- Join Date
- Jul 2007
- Thanked 0 Times in 0 Posts
Setting the 'save as' name, from text in a table (WORD 2003)
Re: Setting the "save as" name, from text in a table
I have a need to pickup and use text which is sitting in a table, within a Word docs header
The Header contains a two column, three row table
The first column has the following text
I need to produce a Macro/VBA code to enable the word document to be saved as the "Commodity Code:", i.e. The text which resides in the second column, first row.
Is this possible?
I have tried to record a macro to do this, but I am not having any luck.
Any help would be appreciated.
2008-08-06, 02:52 #2
- Join Date
- Mar 2002
- Thanked 30 Times in 30 Posts
Re: Setting the 'save as' name, from text in a table (WORD 2003)
Dim strTitle As String
strTitle = ActiveDocument.Sections(1).Headers(wdHeaderFooterP rimary). _
strTitle = Left(strTitle, Len(strTitle) - 2)
.Title = strTitle
The method for setting the Save As name is from How to set the default suggested filename to be displayed by the Save As dialog the first time a user saves a new document.