Messages - questorfla [ switch to compact view ]

Pages: prev1 ... 6 7 8 9 10 [11] 12 13 14 15 16 ... 114next
51
This is something that might have other solutions but if it can be done in a single script it would be handy.  VBS PS Batch whatever.
the content is a list of hyperlinks that need to be emailed.  Currently I do it by building an RTF file which then has to be zipped to be attached to an email.

i have it all working but would like to remove the extra steps required at each end for zipping and unzipping as well as making each written hyperlink active when clicked.

I am now building the .rtf file line by line in a separate script and it would be helpful to instead read each line into the body of the email that is used to send it. 

Currently, i am using a VBS script to get to where i go now.  Once i get to the steps that open Outlook and begin the email, i would need to add the correct vbs code to read the hyperlinks from one location and paste them into the email body then go to the next line for the next hyperlink.

The end result would be a list of maybe 40 hyperlinks which the end of the VBS script adds the recipient's name and sends it on its way.

The code below works by me dropping the zipped file onto the VBS script on my desktop to initiate and send the email.

It works fine that way except for the zipping /unzipping, etc

Is there a way to add the proper code to create the content for the body at step "oEmailItem.BodyFormat = olFormatHTML"?

What would be the proper statement to add to the VBS to loop through a list if hyperlinks and write them to the email body?

Currently the first script i use echoes the variables to the .rtf file.  I tried loading the contents of the entire .rtf file to the email body but it loses all the layout and everything runs together.

Thanks for any ideas.  Note that i the code below i used "examples" for the recipient but the rest is pretty much working as is.


Option Explicit
Dim objArgs, OutApp, oNameSpace, oInbox, oEmailItem, olMailItem
Dim a, oAttachments, subjectStr, olFormatHTML
olMailItem = 0
olFormatHTML = 2
Set objArgs = WScript.Arguments 'gets paths of selected files
Set OutApp = CreateObject("Outlook.Application") 'opens Outlook
Set oEmailItem = OutApp.CreateItem(olMailItem) 'opens new email
oEmailItem.To = "recipient@email.com"
oEmailItem.cc = ""
For a = 0 to objArgs.Count - 1
Set oAttachments = oEmailItem.Attachments.Add(objArgs(a))
subjectStr = subjectStr & Right(objArgs(a),Len(objArgs(a))-(InStrRev(objArgs(a),"\"))) & ", " 'recreates the default Subject e.g. Emailing: file1.doc, file2.xls
Next
If subjectStr = "" then subjectStr = "No Subject "
oEmailItem.Subject = "Subject"
oEmailItem.BodyFormat = olFormatHTML
oEmailItem.Display
oEmailItem.Send


52
The following code is part of an HTML file used to display images. There are several lines before his but i cut to the chase with the only working part I need help with.  I need to get it to add a line feed <br> only before it displays a .jpg file.

The contents of the folder are all png image files except for the index images which are jpg.  I am trying to get them to show up with all the png under the index they belong to.
If working properly, it should start by adding a line feed before displaying the first index file named "A.jpg", then display A.jpg followed by all the the A***.png files, then add a linefeed before displaying the "B.jpg index" followed by the B***.png files.

I am pretty sure that this needs to happen in the last 4 lines of code but I cannot seem to get the <br> to work dependent on the type of file.
 I need to add a <br> to the front of the display only if the file-type is a jpg.
 
As it is now, it displays the files end to end with the title indexes being followed by their png's then the next index file with no break. 
This works as is but I would like to try getting it a little better organized for display purposes.


<?php
$folder_path 
'images/'//image's folder path
$num_files glob($folder_path "*.{JPG,jpg,gif,png,bmp}"GLOB_BRACE);
$folder opendir($folder_path);
 if(
$num_files 0)
{
 while(
false !== ($file readdir($folder))) 
 {
  
$file_path $folder_path.$file;
  
$extension strtolower(pathinfo($file ,PATHINFO_EXTENSION)); 
    if(
$extension=='jpg' || $extension =='png' || $extension == 'gif' || $extension == 'bmp'
  {
  
  $txtfile_temp basename($file_path".".$extension).PHP_EOL;
  $txtfile $folder_path.trim($txtfile_temp).".txt";
  
  $fp fopen($txtfile"r");
      if (
$fp == false)
      {
   $file_path "Failed to open ".$txtfile;
   $line "Failed to open ".$txtfile;
  }
      else
      {
      
$line fgets($fp);
      
fclose($fp);   
  }
   
?>

            <a href="<?php echo "".$line?>"><img src="<?php echo $file_path?>"  height="300" /></a>
            <?php
         
}

53
Just wanted to say it's great to see people helping each other out on little projects like this  :up:

Thanks Mouser:  DC has been my 100% ALL TIME BEST site for "goTo" help.
The "other guys"  don't come close.   :Thmbsup:

54
Only one minor edit and 4WD saved the day again!   :Thmbsup:
As below, I only added '/index' to var in your code so the page opens in the browser. !perfect!

I was trying to skimp too much      :-[
I was hoping to get by using the "form" setup by itself but could not manage the last bit whether I used "get" or "post" or ??

You are a Lifesaver!  >>as usual   8)
Hope you enjoyed a Great Christmas PLUS 'Boxing Day'  :)
Us poor Yanks only get Christmas :(   
uhm ...Well Plus
New Years Day

and of course

 INAUGURATION DAY! 

 

<HTML>
  <HEAD>
    <SCRIPT LANGUAGE="JavaScript">
      function goToPage(form) {
        var initial = "http://www.oracle.com/";
        var extension = "/index.html";
        var newurl = initial + form.subpage.value + extension;
        window.location.assign(newurl);
      }
    </SCRIPT>
    <TITLE>Redirect Test</TITLE>
  </HEAD>
  <BODY>
    <P>
    <FORM name="form" action="" method="GET">
      Input word:
      <INPUT type="text" name="subpage" value="">
      <INPUT type="button" Name="button" value="GO" onClick="goToPage(this.form);">
    </FORM>
  </BODY>
</HTML>

55
This might be simpler that I am showing below but the idea is to allow a user to complete a URL link and go there.

My best arrangement only works insofar as it doesn't crash.
A lot of the info below could even be deleted and it still 'works' to get to oracle but nothing i have tried can take the input from the user and add it to the href statement.

Any info appreciated even if it means using a completely alternative method as long as it Looks and works as intended. (and is short :) )

<!DOCTYPE html>
<html>
<body>
     <form name ="gotourl" action=" " method="post"
     <p> Enter Final Word Here -
     <input type="text" name="fword"
     <br><br>
     <a href="https://www.oracle.com/"fword>”CLICK to go”</a>
     </form-name>
</body>
</html>

Example would be if you want to go to:
https://www.oracle.com/sun

But you only wanted the use to enter the word "sun" in the box displayed  Typing it in the box and clicking the work "click to go" just goes to oracle.com and the "sun" subdirectory does not get added.

Something like this would probably be proper using a lot of PHP but I was hoping for a simpler HTML version to add an input to a line of code and go there.

Since I admittedly don't how to do it, there may well be one
 :(

Pages: prev1 ... 6 7 8 9 10 [11] 12 13 14 15 16 ... 114next
Go to full version