View Single Post
 
Old 11-16-2014, 10:18 PM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Quote:
Originally Posted by tintin007 View Post
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'.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote