<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Les forums de JeBulle.net – [vb] Fonctions]]></title>
	<link rel="self" href="https://forums.jebulle.net/feed/atom/topic/364/" />
	<updated>2004-07-08T15:22:03Z</updated>
	<generator>PunBB</generator>
	<id>https://forums.jebulle.net/topic/364/vb-fonctions/</id>
		<entry>
			<title type="html"><![CDATA[Re: [vb] Fonctions]]></title>
			<link rel="alternate" href="https://forums.jebulle.net/post/5208/#p5208" />
			<content type="html"><![CDATA[<p>ben voila c&amp;#39;etait pas dur <img src="https://forums.jebulle.net/img/smilies/wink.png" width="15" height="15" alt="wink" /></p><p>si tu as d&amp;#39;autres problemes hésite pas a demander <img src="https://forums.jebulle.net/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /></p><p>plus serieusement sur les treeview,si tu as besoin d&amp;#39;aide, je peut t&amp;#39;envoyer ce que j&amp;#39;ai fait pour mon projet vu que c&amp;#39;etait un peu le theme principal <img src="https://forums.jebulle.net/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>tiens moi au courant</p>]]></content>
			<author>
				<name><![CDATA[rupert2703]]></name>
				<uri>https://forums.jebulle.net/user/8/</uri>
			</author>
			<updated>2004-07-08T15:22:03Z</updated>
			<id>https://forums.jebulle.net/post/5208/#p5208</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: [vb] Fonctions]]></title>
			<link rel="alternate" href="https://forums.jebulle.net/post/5207/#p5207" />
			<content type="html"><![CDATA[<p>As-tu une petite fonction qui compte le nombre d&amp;#39;enfant d&amp;#39;un noeud dans une TreeView sous la main ???</p><br /><p>Edit : Bon finalement c&amp;#39;est pas la peine, j&amp;#39;ai trouvé &amp;#33; <br /></p><div class="codebox"><pre><code>TreeView.SelectedItem.Children</code></pre></div><p>Ca retourne le nombre d&amp;#39;enfant du node selectionné.</p><p>J&amp;#39;étais parti très loin alors que j&amp;#39;avais la solution directement &amp;#33;&nbsp; <img src="https://forums.jebulle.net/img/smilies/roll.png" width="15" height="15" alt="roll" />&nbsp; &nbsp;<img src="https://forums.jebulle.net/img/smilies/lol.png" width="15" height="15" alt="lol" /></p>]]></content>
			<author>
				<name><![CDATA[Cyberbob002]]></name>
				<uri>https://forums.jebulle.net/user/5/</uri>
			</author>
			<updated>2004-07-08T13:48:49Z</updated>
			<id>https://forums.jebulle.net/post/5207/#p5207</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: [vb] Fonctions]]></title>
			<link rel="alternate" href="https://forums.jebulle.net/post/5206/#p5206" />
			<content type="html"><![CDATA[<p>et voici encore une petite fonction made in maison <img src="https://forums.jebulle.net/img/smilies/smile.png" width="15" height="15" alt="smile" /> (inspiré quand meme <img src="https://forums.jebulle.net/img/smilies/wink.png" width="15" height="15" alt="wink" /></p><p>elle permet de remplacer tous les espaces par des undescore dans le nom des fichiers pour un répertoire donné</p><p>celà peut s&amp;#39;avérer très utile <img src="https://forums.jebulle.net/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><div class="codebox"><pre><code>Private Sub Bouton_Click&amp;#40;&amp;#41;

Dim fixe As String
Dim rep As String

fixe = &amp;#34;c&amp;#58;&amp;#092;temp&amp;#092;&amp;#34;

&amp;#39;obtient le premier fichier qui est dans le repertoire defini
rep = Dir&amp;#40;fixe &amp; &amp;#34;*.*&amp;#34;, vbDirectory&amp;#41;
&amp;#39;boucle tant que le répertoire n&amp;#39;a pas été entièrement parcouru
Do While &amp;#40;rep &amp;#60;&amp;#62; &amp;#34;&amp;#34;&amp;#41;
 &amp;nbsp; &amp;nbsp;If rep &amp;#60;&amp;#62; &amp;#34;.&amp;#34; And rep &amp;#60;&amp;#62; &amp;#34;..&amp;#34; Then
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Name fixe &amp; rep As fixe &amp; Replace&amp;#40;rep, &amp;#34; &amp;#34;, &amp;#34;_&amp;#34;&amp;#41;
 &amp;nbsp; &amp;nbsp;End If
 &amp;nbsp; &amp;nbsp;&amp;#39;passe à l&amp;#39;élément suivant
 &amp;nbsp; &amp;nbsp;rep = Dir
Loop
MsgBox &amp;#40;&amp;#34;Fini&amp;#34;&amp;#41;

End Sub</code></pre></div><p>je n&amp;#39;ai pas fait l&amp;#39;exploration en profondeur, elle marche uniquement pour un dossier qui ne contient QUE des fichiers, mais c&amp;#39;est déjà un bon début <img src="https://forums.jebulle.net/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[rupert2703]]></name>
				<uri>https://forums.jebulle.net/user/8/</uri>
			</author>
			<updated>2004-07-08T11:33:36Z</updated>
			<id>https://forums.jebulle.net/post/5206/#p5206</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: [vb] Fonctions]]></title>
			<link rel="alternate" href="https://forums.jebulle.net/post/5137/#p5137" />
			<content type="html"><![CDATA[<p>OK d&amp;#39;ac &amp;#33;</p>]]></content>
			<author>
				<name><![CDATA[Cyberbob002]]></name>
				<uri>https://forums.jebulle.net/user/5/</uri>
			</author>
			<updated>2004-06-29T08:20:37Z</updated>
			<id>https://forums.jebulle.net/post/5137/#p5137</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: [vb] Fonctions]]></title>
			<link rel="alternate" href="https://forums.jebulle.net/post/5136/#p5136" />
			<content type="html"><![CDATA[<p>elle marche dans un certaine mesure, la taille d&amp;#39;un quote n&amp;#39;est pa égale à la taille d&amp;#39;un double quote et quand tu travaille avec les longueurs des mots, celle ci te fait l&amp;#39;adaptation donc c&amp;#39;est ce qu&amp;#39;il me faut <img src="https://forums.jebulle.net/img/smilies/wink.png" width="15" height="15" alt="wink" /></p><p>en plus je l&amp;#39;ai allégé pour poster sur le forum mais elle me remplace également mes caractères spéciaux, je fait tout dans une fonction ca m&amp;#39;évite d&amp;#39;écrire 20 lignes avec replace=.., je lui passe une chaine et il me renvoie la chaine épuré <img src="https://forums.jebulle.net/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></content>
			<author>
				<name><![CDATA[rupert2703]]></name>
				<uri>https://forums.jebulle.net/user/8/</uri>
			</author>
			<updated>2004-06-29T07:39:38Z</updated>
			<id>https://forums.jebulle.net/post/5136/#p5136</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: [vb] Fonctions]]></title>
			<link rel="alternate" href="https://forums.jebulle.net/post/5132/#p5132" />
			<content type="html"><![CDATA[<p>je n&amp;#39;ai pas tout regardé mais ta fonction pour remplacer les quotes par des doubles quotes me parait bien longue &amp;#33;&amp;#33; <br /></p><div class="codebox"><pre><code>test = Replace&amp;#40;test ,&amp;#34;&amp;#39;&amp;#34;,&amp;#34;&amp;#34;&amp;#34;&amp;#34;&amp;#41;</code></pre></div><p>Ca ne suffit pas ca ??</p><br /><p>Par contre ta fonction pour les documents Word et le mail me plait bien ... <img src="https://forums.jebulle.net/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></content>
			<author>
				<name><![CDATA[Cyberbob002]]></name>
				<uri>https://forums.jebulle.net/user/5/</uri>
			</author>
			<updated>2004-06-28T17:26:26Z</updated>
			<id>https://forums.jebulle.net/post/5132/#p5132</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: [vb] Fonctions]]></title>
			<link rel="alternate" href="https://forums.jebulle.net/post/5122/#p5122" />
			<content type="html"><![CDATA[<p>voila de quoi remplir un fichier word, cette fonction nécessite la référence microsoft word x.x object library</p><div class="codebox"><pre><code>Dim oWord As Word.Application
Set oWord = New Word.Application
oWord.Visible = True &amp;#39;détermine si le fichier est visible
oWord.DisplayAlerts = wdAlertsNone
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
oWord.Documents.Add App.Path &amp; &amp;#34;&amp;#092;document.doc&amp;#34; &amp;#39; charge un fichier existant
&amp;#39;Mise en gras
oWord.Selection.Font.Bold = 1
oWord.Selection.typetext Text&amp;#58;=&amp;#34;bla bla&amp;#58; &amp;#34; &amp;#39; remplit le document
&amp;#39;enleve le gras
oWord.Selection.Font.Bold = 0

&amp;#39;Sauvegarde et quitte
oWord.ActiveDocument.SaveAs App.Path &amp; &amp;#34;&amp;#092;document.doc&amp;#34;
oWord.Quit</code></pre></div><p>je ne vous ai mis qu&amp;#39;une seule propriété de mise ne page mais j&amp;#39;en ai plusieurs pages de propriétés alors demander si vous avez besoin <img src="https://forums.jebulle.net/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></content>
			<author>
				<name><![CDATA[rupert2703]]></name>
				<uri>https://forums.jebulle.net/user/8/</uri>
			</author>
			<updated>2004-06-28T07:19:37Z</updated>
			<id>https://forums.jebulle.net/post/5122/#p5122</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: [vb] Fonctions]]></title>
			<link rel="alternate" href="https://forums.jebulle.net/post/5121/#p5121" />
			<content type="html"><![CDATA[<p>une petite fonction bien utile qui permet de remplacer les quote par des double quote, pratique dans les requetes sql <img src="https://forums.jebulle.net/img/smilies/wink.png" width="15" height="15" alt="wink" /></p><div class="codebox"><pre><code>Public Function Doublequote&amp;#40;ByVal vntValue As Variant&amp;#41; As Variant
Dim i, j As Integer
Dim intLngDest As Integer, intLngSource As Integer

 &amp;nbsp; &amp;nbsp;If IsNull&amp;#40;vntValue&amp;#41; Then
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Exit Function
 &amp;nbsp; &amp;nbsp;End If
 &amp;nbsp; &amp;nbsp;If &amp;#34;&amp;#39;&amp;#34; &amp;#60;&amp;#62; &amp;#34;&amp;#39;&amp;#39;&amp;#34; Then
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;intLngDest = Len&amp;#40;&amp;#34;&amp;#39;&amp;#39;&amp;#34;&amp;#41;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;If intLngDest = 0 Then
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;intLngDest = 1
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End If
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;intLngSource = Len&amp;#40;&amp;#34;&amp;#39;&amp;#34;&amp;#41;
 &amp;nbsp; &amp;nbsp;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i = 1
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;j = InStr&amp;#40;i, vntValue, &amp;#34;&amp;#39;&amp;#34;&amp;#41;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;While j &amp;#60;&amp;#62; 0
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;vntValue = Left&amp;#40;vntValue, j - 1&amp;#41; &amp; &amp;#34;&amp;#39;&amp;#39;&amp;#34; &amp; Right&amp;#40;vntValue, Len&amp;#40;vntValue&amp;#41; - &amp;#40;j + intLngSource - 1&amp;#41;&amp;#41;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i = j + intLngDest
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;j = InStr&amp;#40;i, vntValue, &amp;#34;&amp;#39;&amp;#34;&amp;#41;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Wend
 &amp;nbsp; &amp;nbsp;End If
 &amp;nbsp; &amp;nbsp;Doublequote = vntValue
End Function</code></pre></div>]]></content>
			<author>
				<name><![CDATA[rupert2703]]></name>
				<uri>https://forums.jebulle.net/user/8/</uri>
			</author>
			<updated>2004-06-28T07:12:00Z</updated>
			<id>https://forums.jebulle.net/post/5121/#p5121</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[[vb] Fonctions]]></title>
			<link rel="alternate" href="https://forums.jebulle.net/post/5120/#p5120" />
			<content type="html"><![CDATA[<p>je poste ici quelques fonctions que j&amp;#39;ai trouvé et modifier parfois et qui sont bien utiles</p><p>envoi de mail</p><div class="codebox"><pre><code>Public Function mail&amp;#40;adresse As String, sujet As String, message As String, origine As String, MonFichier As String&amp;#41;
&amp;#39; Fonction de mail

Set objmail = CreateObject&amp;#40;&amp;#34;CDONTS.NewMail&amp;#34;&amp;#41;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;objmail.From = origine
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;objmail.To = adresse
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;objmail.Subject = sujet
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;objmail.Body = message
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;objmail.AttachFile MonFichier
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;objmail.Send

End Function</code></pre></div><p>Cette fonction nécessite l&amp;#39;utilisation de la dll CDONTS qui est par défaut avec un serveur IIS, si vous ne l&amp;#39;avez pas, telechargez la et executer ensuite la ligne suivante </p><div class="codebox"><pre><code>regsvr32 cdonts.dll</code></pre></div><p>cela aura pour effet de l&amp;#39;enregistrer aupres de votre os</p>]]></content>
			<author>
				<name><![CDATA[rupert2703]]></name>
				<uri>https://forums.jebulle.net/user/8/</uri>
			</author>
			<updated>2004-06-28T07:10:17Z</updated>
			<id>https://forums.jebulle.net/post/5120/#p5120</id>
		</entry>
</feed>
