PDA

View Full Version : Macro that opens a Userform and then automatically add the info into the text



sb003848
08-14-2013, 10:46 AM
Hello,

I created a file in which a UserForm is shown once the file is opened. The userform looks like this:

10441

I wish to use the infor found in the 7 fields in order to change the the red text in the following HTML code:

<UL class=videos>
<LI>
<DIV class="gallery clearfix wmv_play"><A href="VIDEO_LINK?width=320&amp;height=240&amp;controls=1" rel=prettyPhoto[movie]><IMG style="MARGIN-TOP: 12px" class=video-screenshot border=0 alt="Visionner la vidéo" src="VIDEO_STILL" width=200 height=113> </A></DIV>
<DIV style="WIDTH: 300px" class=video-details>
<P class=video-title>VIDEO_TITLE</P>
<P class=video-trans></P>
<DIV class="gallery clearfix wmv_play"><A href="VIDEO_LINK?width=320&amp;height=240&amp;controls=1" rel=prettyPhoto[movie]>Visionner la vidéo</A> &nbsp;VIDEO_MIN mins&nbsp; VIDEO_SEC sec <BR><A href="Lire'>VIDEO_RELATED_ARTICLE">Lire l'article complet</A>
<P class=video-date>VIDEO_DATE</P></DIV></DIV></LI></UL>

The data in red must be replaced by the data found in the form.

VIDEO_LINK needs to be replace by the value found in TextBox1
VIDEO_STILL needs to be replace by the value found in TextBox2
VIDEO_TITLE needs to be replace by the value found in TextBox3
VIDEO_MIN needs to be replace by the value found in TextBox4
VIDEO_SEC needs to be replace by the value found in TextBox5
VIDEO_RELATED_ARTICLE needs to be replace by the value found in TextBox6
VIDEO_DATE needs to be replace by the value found in TextBox7

Any ideas how I can create such a Macro?

Thanks for your time