R
Rigoletto Eikenberg
Hello,
i want to save .dot-Attachments from outlook with customized
"CustomDocumentProperties" in the .dot-folder.
To save the .dot-File in the folder works fine, but the
"CustomDocumentProperties" are forgotten. I can check they after adding with
MsgBox wrd.ActiveDocument.CustomDocumentProperties("BI_NAME")
but they are not saved. I try "save" and "close" with paramenters to save
without asking for it. But it does not work too.
I record parts of the script in word as a marco and copy it to word. In word
in runs fine, only when i try to put it in outlook the problem occurs.
Can somebody help?
Rigoletto
Office XP with SP2
Sub vorlagen_speichern_Click() ' .dot-Anlagen werden im Vorlagenverz.
gespeichert und aktuallisiert.
i = 0
Set wrd = CreateObject("Word.Application")
dotpath = wrd.Options.DefaultFilePath(2)
' wrd.Application.Visible = True
Set colAtts = Item.Attachments
If colAtts.Count > 0 Then
For Each objAtt In colAtts
If Right(objAtt.Filename, 4) = ".dot" then
strFile = dotpath & "\" & objAtt.FileName
objAtt.SaveAsFile strFile
i = i + 1
wrd.Documents.Open (strFile)
On Error Resume Next
wrd.ActiveDocument.CustomDocumentProperties("BI_NAME").Delete
On Error Goto 0
wrd.ActiveDocument.CustomDocumentProperties.Add "BI_NAME", 0, 4,
"Rigoletto Eikenberg"
wrd.ActiveDocument.Save
wrd.ActiveDocument.Close
End If
Next
MsgBox i & " Word-Vorlagen in " & dotpath & " installiert."
else
MsgBox "Es sind keine Anlagen vorhanden die als Word-Vorlage gespeichert
werden könnten."
End If
Set wrd = Nothing
End Sub
i want to save .dot-Attachments from outlook with customized
"CustomDocumentProperties" in the .dot-folder.
To save the .dot-File in the folder works fine, but the
"CustomDocumentProperties" are forgotten. I can check they after adding with
MsgBox wrd.ActiveDocument.CustomDocumentProperties("BI_NAME")
but they are not saved. I try "save" and "close" with paramenters to save
without asking for it. But it does not work too.
I record parts of the script in word as a marco and copy it to word. In word
in runs fine, only when i try to put it in outlook the problem occurs.
Can somebody help?
Rigoletto
Office XP with SP2
Sub vorlagen_speichern_Click() ' .dot-Anlagen werden im Vorlagenverz.
gespeichert und aktuallisiert.
i = 0
Set wrd = CreateObject("Word.Application")
dotpath = wrd.Options.DefaultFilePath(2)
' wrd.Application.Visible = True
Set colAtts = Item.Attachments
If colAtts.Count > 0 Then
For Each objAtt In colAtts
If Right(objAtt.Filename, 4) = ".dot" then
strFile = dotpath & "\" & objAtt.FileName
objAtt.SaveAsFile strFile
i = i + 1
wrd.Documents.Open (strFile)
On Error Resume Next
wrd.ActiveDocument.CustomDocumentProperties("BI_NAME").Delete
On Error Goto 0
wrd.ActiveDocument.CustomDocumentProperties.Add "BI_NAME", 0, 4,
"Rigoletto Eikenberg"
wrd.ActiveDocument.Save
wrd.ActiveDocument.Close
End If
Next
MsgBox i & " Word-Vorlagen in " & dotpath & " installiert."
else
MsgBox "Es sind keine Anlagen vorhanden die als Word-Vorlage gespeichert
werden könnten."
End If
Set wrd = Nothing
End Sub