Rey Taino
Rey Taino

Reputation: 179

Hide commandbutton when coverting Word Doc to PDF

When converting to pdf using a commandbutton that creates an Outlook email, coverts docfile to pdf, and attached file - the pdf file still displays the commandbuttons on the form.

Is there a way to hide the commandbuttons or make them invisible before converting from Word Doc to pdf format.

If VName.Value = "" Then
     Doc.SaveAs ("Quotation_Blank 2016")    Else
     FileName = "QFORM" & "_" & JNumber.Value & "_" & VName.Value
     Doc.ExportAsFixedFormat OutputFileName:=THE_PATH & FileName, _
     ExportFormat:=wdExportFormatPDF  
End If

enter image description here

Upvotes: 0

Views: 2082

Answers (1)

Fink
Fink

Reputation: 3436

Depending on the button type there might be a Print Object property for the button object that might show/hide the button when being exported. Otherwise you might have to set the Visible property on the button to 'False' before exporting, then turn Visible back to 'True' after. Might depend on if you're using 'ActiveX' controls or 'Form' controls, so you might have to play around with those settings a bit depending on your setup.

Upvotes: 1

Related Questions