OpenPop message.Save - outlook

I am trying to save the email msg as a file on the local drive.
FileInfo msgfile = new FileInfo(Path.Combine(#"C:\\Users\\Public\\Documents\\msg-" + filenumber + ".msg"));
getMessage.Save(msgfile);
But when I attempt to open the file Outlook gives me the following error
If i open the same file in Notepad i don't get any error.
Suggestions???
Regards
MRRCOMP

I solved by saving with extension .eml and not msg
Hope this helps others
Regards

Related

How to fix 'The file .... does not exist in Laravel?

I want to download file from storage folder in my Laravel project.
This is the method I'm using to download the file:
return response()->download(storage_path($path), $name);
When I click the link which redirects to this method I receive this output from the browser:
Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException
The file "pathToTheFile" does not exist.
The problem is that when I go to www.mydomain.com/pathToTheFile, the browser shows me this txt file. Why doesn't it download the file from the link? Anyone can help?
The file is uploaded using Voyager Admin Package if it's important.
I resolved the problem. The method should be:
return Storage::disk('public')->download($path, $name);
Thanks for help anyway :)
1.Method:
$filePath = public_path("storage/app/public/test.xlsx");
return response()->download($filePath);
get "file does not exist" error.
2.Method:
$filePath = public_path("storage/app/public/test.xlsx");
return Storage::disk('public')->download($filePath);
get "Unable to retrieve the file_size for file at location" error.
3.Method: (Solution for me)
$filePath = storage_path('/app/public/test.xlsx');
return response()->download($filePath);

Copying a file from one server to another server in same domain using vbscript

I am new to Vb script.
I need to copy a file from one server location to another server. I am using a code below:
Set objFSO = CreateObject("Scripting.FileSystemObject")
strSourcePath = "D:\sample.txt"
strDestinationPath = "\\servername\D:\foldername\"
objFSO.CopyFile strSourcePath,strDestinationPath
But I am getting a "Path not found" error and i would like a message that file has been copied in a text file.
Can you please help me with this?
The share name must be used on the destination path, eg. \\servername\d$\foldername\
D: is not a share, but d$ is an admin share.

Getting error 800a03ec while opening an Excel file

I have written following code to convert XLSX file to CSV format:
If WScript.Arguments.Count < 2 Then
WScript.Echo "Error! Please specify the source path and the destination. Usage: XlsToCsv SourcePath.xls Destination.csv"
Wscript.Quit
End If
Dim oExcel
Set oExcel = CreateObject("Excel.Application")
Dim oBook
Set oBook = oExcel.Workbooks.Open(Wscript.Arguments.Item(0))
oBook.SaveAs WScript.Arguments.Item(1), 6
oBook.Close False
oExcel.Quit
It was working fine when I was giving server path for XLSX file. But, when I am giving local machine path, it is giving me following error:
File could not be found. Check the spelling of the file name, and verify that file location is correct. If you are trying to open the file from list of most recently used files, make sure that file has not been renamed, moved or deleted
code: 800A03EC
Source: Microsoft Office Excel
In case anyone with a similar problem finds this, the error code seems to be a general Excel error which means that it could not open the file.
In my case I tried opening the same file manually and found that Excel wanted to repair a corrupted file. I had been allowed to save it with incorrect validations, but it wouldn't open programmatically. Opening it by hand meant that it could show me a dialog asking whether I wanted to fix it or not.
If you are still getting this error, I would do a simple echo on both your arguments to make sure they are doing exactly what they should be doing
wscript.echo "Arg(0): " & WScript.Arguments.Item(0) & " Arg(1): " & WScript.Arguments.Item(1)
Also if you are using cscript.exe to run it, it will by default be looking for the files in c:\windows\system32\ directory
In my case the corresponding message is "Unable to set the PaperSize property of the PageSetup class". That occurs when the standard printer is not capable of the page format of the Excel workbook/sheet.

Command Prompt error since i am using a generic path to open an excel file

Command Prompt its not working since i am using a generic path to open a excel file. Here is the error message:
T:\PointOfSale\Projects\Automated Testing\TASWeb\TP\TP_Branch>ruby -rubygems Tes
tTP_UK.rb
TestTP_UK.rb:19:in 'method_missing': (in OLE method `Open': )(WIN32OLERuntimeEr
ror)
OLE error code:800A03EC in Microsoft Excel
'./../../../MasterFile.xls' could not be found. Check the spelling of the
file name, and verify that the file location is correct.
If you are trying to open the file from your list of most recently used files, m
ake sure that the file has not been renamed, moved, or deleted.
HRESULT error code:0x80020009
Exception occurred.
from TestTP_UK.rb:19:in `'
enter code here'
Generic path code
excel = WIN32OLE::new("excel.Application")
path = "#{File.dirname(__FILE__)}/../../../MasterFile.xls"
workbook = excel.Workbooks.Open(path)
worksheet = workbook.WorkSheets(1) # Get first workbook
site = worksheet.Range('A2').Value # Get the value at cell in worksheet.
workbook.Close
excel.Quit
Any Ideas
I believe you need to use an absolute path rather than a relative path when opening the file:
path = File.expand_path("../../../../MasterFile.xls", __FILE__)
Note that you will also need an additional '..' when using expand_path, since the first '..' is going back from the file.

Unknown reason of an error while debugging an Opencv project using opencv2 functions

I have openCV 2.3 and I am using Visual Studio 2010.
...
VideoCapture cap;
cap.open("Video.avi");
if( !cap.isOpened() )
{
puts("***Could not initialize capturing...***\n");
system("Pause");
return 0;
} ...
This is a code snippet of the while program.
I added a system command in order to hold the output window. I got no errors while building the project but when I began debugging, the output window had this output :
warning: Error opening file (../../modules/highgui/src/cap_ffmpeg_impl.hpp:477)
***Could not initialize capturing...***
Press any key to continue . . .
I checked this directory, the file is available but then why is it that it doesn't open ?
I even have the opencv_ffmpeg.dll in the bin folder with its path added to System Paths.
Still I get this same error ....
I even checked first 3 pages of google search I did but could not find an answer.
So please help!
The error which I mentioned is because, there has been an error in opening the .avi file ...
This is the part of code in cap_ffmpeg_impl.hpp -
int err = av_open_input_file(&ic, _filename, NULL, 0, NULL);
if (err < 0) {
CV_WARN("Error opening file"); //Error part
goto exit_func;
}
This file is available at D:\OpenCV2.3\opencv\modules\highgui\src. When I make any changes in this file, they do not reflect on the output window and when I removed this file, even then it did not give any error!:O
I am not able to understand what is happening ....??
The error message is perhaps a bit confusing. You should read it like this:
<severity>: <message> (<where the message originated from>)
The message does not tell you, that your program is unable to open the header file, it just informs you that the message was created in that header file.
As you observed correctly, the problem is, that your program cannot find the .avi file. Try supplying the absolute path to that video file:
cap.open("C:/absolute/path/to/Video.avi");

Resources