Hello,
I need help with a report I developed in MS Word. It has several links to an MS Excel workbook, one of which is in the footer. I need to write a macro that will update all the links (including the one in the footer) and publish the document as a pdf. Each time the links are updated, the first sentence of the document changes. It is this sentence that should be used as the file name for the document as they are saved. Below is what I have so far.
Sub UpdateProfile()
Selection.WholeStory
Selection.Fields.Update
End Sub
(This updates all the links but the one in the footer)
Sub Publish()
Dim DistrictName As String
DistrictName = (ActiveDocument.Sentences(1).Text)
ActiveDocument.ExportAsFixedFormat OutputFileName:= _
"C:\Documents and Settings\Desktop\" & DistrictName.Text & ".pdf"
End Sub
(This results in an invalid file name error)
Thank you
I need help with a report I developed in MS Word. It has several links to an MS Excel workbook, one of which is in the footer. I need to write a macro that will update all the links (including the one in the footer) and publish the document as a pdf. Each time the links are updated, the first sentence of the document changes. It is this sentence that should be used as the file name for the document as they are saved. Below is what I have so far.
Sub UpdateProfile()
Selection.WholeStory
Selection.Fields.Update
End Sub
(This updates all the links but the one in the footer)
Sub Publish()
Dim DistrictName As String
DistrictName = (ActiveDocument.Sentences(1).Text)
ActiveDocument.ExportAsFixedFormat OutputFileName:= _
"C:\Documents and Settings\Desktop\" & DistrictName.Text & ".pdf"
End Sub
(This results in an invalid file name error)
Thank you