Jfp87
09-18-2014, 03:44 PM
Guys, another few questions. First, here's the code (word 2010):
file = Dir("F:\Joe\Test Folder\Test Destination\")
Do While Len(file) > 0
With Documents(file)
.Bookmarks("Discip").Range.Text = strDiscip
.Bookmarks("ProjectNumber").Range.Text = lngProjNum
.Bookmarks("Rev").Range.Text = "A1"
.ContentControls(1).Range.Text = Me.cboClient.Value
.ContentControls(2).Range.Text = cboAsset.Value
.ContentControls(3).Range.Text = txtWpkDocNo.Value
.ContentControls(4).Range.Text = Me.cboDiscip.Value
.ContentControls(5).Range.Text = txtWpkTitle.Value
End With
file = Dir
Loop
When I run the code I am getting an error at line 3 saying "bad file name". I am unsure if this error is a problem with the code or one of my files.
Second question relates to the first: is it possible to have identical bookmarks in multiple documents, and update all of them? That's what I'm trying to do.
Again, the helps appreciated.
Joe
file = Dir("F:\Joe\Test Folder\Test Destination\")
Do While Len(file) > 0
With Documents(file)
.Bookmarks("Discip").Range.Text = strDiscip
.Bookmarks("ProjectNumber").Range.Text = lngProjNum
.Bookmarks("Rev").Range.Text = "A1"
.ContentControls(1).Range.Text = Me.cboClient.Value
.ContentControls(2).Range.Text = cboAsset.Value
.ContentControls(3).Range.Text = txtWpkDocNo.Value
.ContentControls(4).Range.Text = Me.cboDiscip.Value
.ContentControls(5).Range.Text = txtWpkTitle.Value
End With
file = Dir
Loop
When I run the code I am getting an error at line 3 saying "bad file name". I am unsure if this error is a problem with the code or one of my files.
Second question relates to the first: is it possible to have identical bookmarks in multiple documents, and update all of them? That's what I'm trying to do.
Again, the helps appreciated.
Joe