Quote:
Originally Posted by tintin007
Hi,
thanks for your reply. the line save as come back as object not supported.
Code:
.SaveAs2 FileName:=strPath & strNum & strName & ".docx"
what does this line do. is it checking for data in the text box tbpanelnumber ??
Code:
If LCase(oCC.Title) = "tbpanelnumber" Then
|
SaveAs2 is not supported by Word 2007. It was introduced with Office 2010, but as you included it in your original message, I assumed that the 2007 reference was perhaps wrong, and followed suit. As Paul suggests SaveAs without the '2' will work in 2007.
The second quoted line checks for a content control name (converted to lower case) called tbpanelnumber.
The macro reads the values of the two named content controls, checks whether you have entered text in them and if you have saves the file with those names. It will not work correctly if either the content control names you quoted are wrong, or if they are not content controls but some other kind of 'text box'.