vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
vb@rchiv Offline-Reader - exklusiv auf der vb@rchiv CD Vol.4  
 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

Fortgeschrittene Programmierung
Also dann... 
Autor: ModeratorDieter (Moderator)
Datum: 23.01.02 11:08

Hi zumkeller,

also dann würde ich eine Select...Case Abfrage verwenden:
<code><font color=#000099>Select</font> <font color=#000099>Case</font> LCase$( _
  Right$(filenameinput, 4))
  <font color=#000099>Case</font> ".xls"
    <font color=#000099>Set</font> xls = CreateObject("Excel.Application")
    <font color=#000099>With</font> xls
      .Visible = <font color=#000099>True</font>
      .Workbooks.<font color=#000099>Open</font> filenameinput
      .ActiveSheet.Activate
      .ActiveChart.ChartArea.<font color=#000099>Select</font>
      .Selection.Copy
      ActivePresentation.Slides(c).Shapes.Paste
      .DisplayAlerts = <font color=#000099>False</font>
      .Quit
      .DisplayAlerts = <font color=#000099>True</font>
    <font color=#000099>End</font> <font color=#000099>With</font>
    <font color=#000099>Set</font> xls = <font color=#000099>Nothing</font>
 
  <font color=#000099>Case</font> ".doc"
    <font color=#000099>Set</font> doc = CreateObject("Word.Application")
    <font color=#000099>With</font> doc
      .Visible = <font color=#000099>True</font>
      .Documents.<font color=#000099>Open</font> filenameinput
      .WordBasic.EditSelectAll
      .WordBasic.SetDocumentVar "MyVar", .WordBasic.Selection
      Text = .WordBasic.GetDocumentVar("MyVar")
      txtNeu.Text = InsertNewLineChars(Left(Text, Len(Text) - 1))
      .Documents.<font color=#000099>Close</font> (0)
      .Quit
    <font color=#000099>End</font> <font color=#000099>With</font>
    <font color=#000099>Set</font> doc = <font color=#000099>Nothing</font>
 
  <font color=#000099>Case</font> ".jpg"
    <font color=#000099>Set</font> Image = ActivePresentation.Slides(c)
    <font color=#000099>With</font> Image.Shapes
      .AddShape(msoShapeRectangle, 300, 200, 250, 150).Fill.UserPicture _
        filenameinput
    <font color=#000099>End</font> <font color=#000099>With</font>
    <font color=#000099>Set</font> Image = <font color=#000099>Nothing</font>
<font color=#000099>End</font> <font color=#000099>Select</font></code>
Cu
Dieter
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
if-then-else67zumkeller23.01.02 10:26
Re: if-then-else369ModeratorDieter23.01.02 10:30
Re: if-then-else33zumkeller23.01.02 10:40
Re: if-then-else382ModeratorDieter23.01.02 10:46
Re: if-then-else35zumkeller23.01.02 10:57
Also dann...479ModeratorDieter23.01.02 11:08
Re: Also dann...35zumkeller23.01.02 11:18

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