vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
TOP-Angebot: 17 bzw. 24 Entwickler-Vollversionen zum unschlagbaren Preis!  
 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 2 
Autor: Gekko
Datum: 19.09.04 17:35


'*********************************************************************
' OpenDocumentProperties -- Fills the dialog with properties
' from a user supplied Office document.
'*********************************************************************
Public Function OpenDocumentProperties() As Boolean
Dim oCustProp As DSOleFile.CustomProperty
Dim sFile As String, sTmp As String

GetFileFromUser:
On Error GoTo Err_Trap

' Ask the user for an OLE Structure Storage file to read
' the document properties from...
With CommonDialog1
.Flags = cdlOFNHideReadOnly Or cdlOFNFileMustExist
.Filter = "Office Files|*.doc;*.xls;*.ppt|All Files|*.*"
.FileName = ""
.ShowOpen
sFile = .FileName
End With
' If the user cancels the dialog, exit out.
If Len(sFile) = 0 Then Exit Function

' Here is where we load the document properties for the file
' selected. The function will return a DocumentProperties object.
' We must have exclusive access to the storage of the file. If
' another app has the file open, this function will raise an error
Set oDocProp = oFilePropReader.GetDocumentProperties(sFile)

On Error Resume Next
' Read in some of the most common properties...
lbName.Caption = oDocProp.Name
lbAppName.Caption = oDocProp.AppName

' This gets the associated icon picture for the file type...
Set imgIcon.Picture = oDocProp.Icon

' The standard document properties are loaded into text boxes,
' and can be changed in this sample. Other properties can be changed
' as well, but these are the only ones we demonstrate here...
txtTitle.Text = oDocProp.Title
txtAuthor.Text = oDocProp.Author
txtComments.Text = oDocProp.Comments

' Fill in the Summary/Statistics information in the Normal
' properties list. These properties are standard Summay and Document
' Properties in OLE...
lstNormalProps.Clear
lstNormalProps.AddItem "Subject: " & oDocProp.Subject
lstNormalProps.AddItem "Category: " & oDocProp.Category
lstNormalProps.AddItem "Company: " & oDocProp.Company
lstNormalProps.AddItem "Manager: " & oDocProp.Manager
lstNormalProps.AddItem "CLSID: " & oDocProp.CLSID
lstNormalProps.AddItem "ProgID: " & oDocProp.ProgId
lstNormalProps.AddItem "Word Count: " & oDocProp.WordCount
lstNormalProps.AddItem "Page Count: " & oDocProp.PageCount
lstNormalProps.AddItem "Paragraph Count: " & oDocProp.ParagraphCount
lstNormalProps.AddItem "Line Count: " & oDocProp.LineCount
lstNormalProps.AddItem "Character Count: " & oDocProp.CharacterCount
lstNormalProps.AddItem "Character Count (w/spaces): " & oDocProp.CharacterCountWithSpaces
lstNormalProps.AddItem "Byte Count: " & oDocProp.ByteCount
lstNormalProps.AddItem "Slide Count: " & oDocProp.SlideCount
lstNormalProps.AddItem "Note Count: " & oDocProp.PresentationNotes
lstNormalProps.AddItem "Hidden Slides: " & oDocProp.HiddenSlides
lstNormalProps.AddItem "MultimediaClips: " & oDocProp.MultimediaClips
lstNormalProps.AddItem "Last Edited by: " & oDocProp.LastEditedBy
lstNormalProps.AddItem "Date Created: " & oDocProp.DateCreated
lstNormalProps.AddItem "Date Last Printed: " & oDocProp.DateLastPrinted
lstNormalProps.AddItem "Date Last Saved: " & oDocProp.DateLastSaved
lstNormalProps.AddItem "Total Editing Time (mins): " & oDocProp.TotalEditTime
lstNormalProps.AddItem "Version: " & oDocProp.Version
lstNormalProps.AddItem "Revision Number: " & oDocProp.RevisionNumber
lstNormalProps.AddItem "Template Name: " & oDocProp.Template
lstNormalProps.AddItem "Presentation Format: " & oDocProp.PresentationFormat
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
Wer kann mir dies übersetzen?897Gekko19.09.04 17:32
Teil 2682Gekko19.09.04 17:35
Teil 3564Gekko19.09.04 17:38
Teil 4576Gekko19.09.04 17:39
Re: Teil 4540eclere20.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