J
Jeffery B Paarsa
Hello,
After editing and transfering edited data from UserForm to the document I
print and save the document. Printed document is normal and I have no
problem with it but I can not open the saved document and I get the following
error...
=====
The Office Open.XML file (Paarsa)(20081224100915).doc cannot be opened
because there are problems with the contents. Ok & Details <<<< buttons
Details ---------
Unspecified error
Location: Part:/word/header2.xml, Line:2, Column:3234
=====
Here is the part of code that saves and print document:
++++++
Memo.CheckSpelling
' ActiveDocument.Fields.Update
Memo.Fields.Update
Set BMRange = Memo.Bookmarks("ToRecip").Range
Pforms.ToRecip.Text = BMRange
Set BMRange = Memo.Bookmarks("ReSub").Range
Pforms.ReSub.Text = BMRange
Set BMRange = Memo.Bookmarks("MemoGreating").Range
Pforms.MemoGreating.Text = BMRange
Set BMRange = Memo.Bookmarks("MemoBody").Range
Pforms.MemoBody.Text = BMRange
Set BMRange = Memo.Bookmarks("MemoClosing").Range
Pforms.MemoClosing.Text = BMRange
.Bookmarks("AddrL1").Range _
.InsertBefore AddrL1
.Bookmarks("AddrL2").Range _
.InsertBefore AddrL2
.Bookmarks("Phone").Range _
.InsertBefore Phone
.Bookmarks("Fax").Range _
.InsertBefore Fax
.Bookmarks("WebURL").Range _
.InsertBefore WebURL
' ActiveDocument.Fields.Update
' Memo.Fields.Update
.Protect wdAllowOnlyFormFields, Noreset:=True
If Pforms.MSave.Value = False Then
Else
Dim SaveDocName As String
SaveDocName = Application.MacroContainer.Path + "\SavedDocs\(" +
Pforms.PLName.Text + ")(" + Format(Date, "YYYYMMDD") + Format(Time, "HHMMSS")
+ ").doc"
Memo.SaveAs FileName:=SaveDocName
End If
If Pforms.M2Copy.Value = True Then
.PrintOut Copies:=2
Else
.PrintOut
End If
Memo.Close wdDoNotSaveChanges
Pforms.Memo.Value = False
End With
End Sub
++++++
After editing and transfering edited data from UserForm to the document I
print and save the document. Printed document is normal and I have no
problem with it but I can not open the saved document and I get the following
error...
=====
The Office Open.XML file (Paarsa)(20081224100915).doc cannot be opened
because there are problems with the contents. Ok & Details <<<< buttons
Details ---------
Unspecified error
Location: Part:/word/header2.xml, Line:2, Column:3234
=====
Here is the part of code that saves and print document:
++++++
Memo.CheckSpelling
' ActiveDocument.Fields.Update
Memo.Fields.Update
Set BMRange = Memo.Bookmarks("ToRecip").Range
Pforms.ToRecip.Text = BMRange
Set BMRange = Memo.Bookmarks("ReSub").Range
Pforms.ReSub.Text = BMRange
Set BMRange = Memo.Bookmarks("MemoGreating").Range
Pforms.MemoGreating.Text = BMRange
Set BMRange = Memo.Bookmarks("MemoBody").Range
Pforms.MemoBody.Text = BMRange
Set BMRange = Memo.Bookmarks("MemoClosing").Range
Pforms.MemoClosing.Text = BMRange
.Bookmarks("AddrL1").Range _
.InsertBefore AddrL1
.Bookmarks("AddrL2").Range _
.InsertBefore AddrL2
.Bookmarks("Phone").Range _
.InsertBefore Phone
.Bookmarks("Fax").Range _
.InsertBefore Fax
.Bookmarks("WebURL").Range _
.InsertBefore WebURL
' ActiveDocument.Fields.Update
' Memo.Fields.Update
.Protect wdAllowOnlyFormFields, Noreset:=True
If Pforms.MSave.Value = False Then
Else
Dim SaveDocName As String
SaveDocName = Application.MacroContainer.Path + "\SavedDocs\(" +
Pforms.PLName.Text + ")(" + Format(Date, "YYYYMMDD") + Format(Time, "HHMMSS")
+ ").doc"
Memo.SaveAs FileName:=SaveDocName
End If
If Pforms.M2Copy.Value = True Then
.PrintOut Copies:=2
Else
.PrintOut
End If
Memo.Close wdDoNotSaveChanges
Pforms.Memo.Value = False
End With
End Sub
++++++