vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
NEU! sevCoolbar 3.0 - Professionelle Toolbars im modernen Design!  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2025
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

VB.NET - Fortgeschrittene
Teil 3 
Autor: Gekko
Datum: 19.09.04 17:38


On Error Resume Next
' The HasMacros property only works for Excel & Word files
' and raises error if document is not one of these. Ignore
' any error for this sample.
Dim sItem As String
sItem = CStr(oDocProp.HasMacros)
If Err Then sItem = "<unknown>"
lstNormalProps.AddItem "Macros Attached: " & sItem

' We'll get the thumnail image of the document (if available)...
Dim oPicDisp As StdPicture
Set oPicDisp = oDocProp.Thumbnail
If oPicDisp Is Nothing Then
chkShowPreview.Enabled = False
Else
Set picPreview.Picture = oPicDisp
chkShowPreview.Enabled = True
End If

On Error GoTo Err_Trap

txtCustName.Text = ""
txtCustValue.Text = ""
lstCustType.ListIndex = 0

' Loop through the custom properties collection and
' add each item to a list box...
lstCustProps.Clear
For Each oCustProp In oDocProp.CustomProperties
sTmp = oCustProp.Name & ": " & CStr(oCustProp.Value)
sTmp = sTmp & " [" & CustTypeName(oCustProp.Type) & "]"
lstCustProps.AddItem sTmp
Next

' Disable items if file is read only...
Call EnableItems((Not oDocProp.IsReadOnly))

' The operation was successful.
OpenDocumentProperties = True
Exit Function

Err_Trap:
' Trap common errors returned from componenet...
Select Case Err.Number
Case &H80040203
' The file is open by another program
MsgBox Err.Description & " Please choose another file."
Err.Clear: Resume GetFileFromUser
Case &H80040202
' The file selected is not an OLE structured storage file
MsgBox Err.Description & " Please choose another file."
Err.Clear: Resume GetFileFromUser
Case &H80040201
' DCOM is not installed -- fall through to MsgBox below
End Select

MsgBox "Error: " & Err.Description, vbCritical, "Err: " & CStr(Err.Number)
End Function

Private Sub UpdateSummaryInfo()
' Quick and dirty save routine...
On Error Resume Next
If txtAuthor.Text <> oDocProp.Author Then
oDocProp.Author = txtAuthor.Text
End If
If txtComments.Text <> oDocProp.Comments Then
oDocProp.Comments = txtComments.Text
End If
If txtTitle.Text <> oDocProp.Title Then
oDocProp.Title = txtTitle.Text
End If
End Sub
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
Wer kann mir dies übersetzen?899Gekko19.09.04 17:32
Teil 2682Gekko19.09.04 17:35
Teil 3565Gekko19.09.04 17:38
Teil 4577Gekko19.09.04 17:39
Re: Teil 4541eclere20.09.04 12:07
Re: Teil 4508Lustlos21.09.04 14:43

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2025 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel