screenshot of errorHaving an issue regullary that I can't export a report to PDF from print preview using Windows 7 & Access 2016.
Get the following error:
Microsoft Access can't save the output data to the file you've selected
The file may be open. If so, close it, and then save the output data to the file again.
If you are using a template, check to make sure the template exits.
If the file isn't open, chect to make sure that you have enough free disk space.
Make sure that the file exists on the path specified.
Check to make sure you have permission to write to the specified folder.
Cannot find any issues, except the file doesn't exists but the specific folder does.
Does anyone have a suggestion how to overcome this? This is not even with VBA code, straight from print preview.
Any help appreciate
The fix
Unticking PDF/A compliant worked to clear the error message in my case.
External Data > PDF or XPS > [Options ...] > PDF/A compliant: untick > [OK] > Optimize for: Standard (publishing online and printing) > [Publish]
Another workaround
Avoid the "PDF or XPS" command and go via:
Print > Printer Name: Microsoft Print to PDF > [OK] > MyFileName.pdf > [Save]
Out of windows folders advances security, took ownership and subfolders and it seems to work for now. Thanks
Related
I have a batch file which launches other .bas files with the help of gwbasic.
Here is the code of the batch file:
graphics
cd basic
gwbasic menut-hp/d
cd \
Then I have the possibility by typing 1 or 2 etc + ENTER to choose which program i want to run. The programs are located in the same directory as my batch file. The programs are xxx.BAS files.
The problem is:
I have a piece of software written in GWBASIC that currently is set up to just print locally to LPT1.
When I disconnect the local printer, the software (gwbasic i guess) sends automatically the things to print to the network printer.
The result is that a lot of A4 papers come out with only a few lines written.
On the local printer, the printer only printed when i exited the batch program.
On the network printer, it's like its non stop synchronizing, and not only when i exit the batch program.
I see 2 solutions:
manage to put a tempo for the printing on the network printer (to refresh every 2 minutes for example)
or try to add a line in the .BAS files, to save the text in a .txt of .pdf file, instead of printing it.. or print it in a pdf file.
I have almost no idea how gwbasic works, even after some researches.
Moreover, i haven't managed to view (and modify) the code of the .BAS files
Sorry for my bad english,
If anyone has any idea, it would help me a lot!
Thank you very much :)
Maybe later, but I enjoy scripting with BASIC and CONSOLE APP.
I recommend you run a command BAT before you BAS code to get default printer
wmic printer get name,default | find "TRUE" > Printer.txt
With this linen you get the similar response into Printer.txt
TRUE Microsoft Print to PDF
After that, in your BAS code, read them and validate printer name or discard network printer before print.
Happy coding!
How do I view my Code output in Notepad++ as a webpage or something similiar?
I have built something but I can't find a button or something like that in Notepad to view it as a webpage or something similiar.
If it is a webpage written in html:
just go where you saved it and click it.
If it is in php:
You will need a web server, save the file in the www directory. and access it like this:
http://localhost/yourfile.php
Simply, save your file with the correct extension in this case html, then click run , in the run menu click launch in, (in whichever is your browser) in my case, chrome.And it should work(:
Add this plugin in Notepad++: Preview HTML but it opens only in IE
To setup Notepad++ for testing your markup or code there are a few things to consider.
When Notepad++ launches do you want a test document opened by default?
What language do you prefer the document to be opened as?
What browser do you wish to test your test file in?
Do we want a shortcut to open test in browser?
If you do not have your local environment setup to run server-side scripts you will be limited to what the browser supports.
In my example setup I will be using .php as my language. There are some variables, but I've chosen what I believe best suit my needs. I'm also using a windows machine.
Create a new file in C:\Program Files (x86)\Notepad++ (or wherever) as php.php (or whatever). This will be the document we keep open and will remain open so long as we never close it.
In Notepad++ go to Settings > Preferences > New Document
In the bottom left there is a drop-down. Select your language (php in my case).
Open php.php in Notepad++.
Go to Run > Modify Shortcut / Delete Command and locate your desired browser (note: this may not work as expected in some browsers i.e. Internet Explorer, go figure).
Create a custom shortcut so your document can be launched to test (unless you are happy with what is already setup).
This will effectively keep your default file open in Notepad++ every time it is launched in your preferred language and allow you to quickly test your markup.
Cntrl + Alt + Shift + I(Alphabet if you want to open in Internet explorer)
I hope this will work.
I've been trying and looking on the internet for ages now, but where exactly do you place the .xap file? I've read that you should place the file in your content folder, but I have a content folder located in;
TheGame\TheGameContent\
But I also have;
TheGame\TheGame\bin\x86\Debug\Content
Which is it? If I add the .xap file to the latter it recognises it when I refresh the solution explorer, but the former does not.
However, if I add the .xap to the latter it gives an error saying it can't find it when I use the following line of code to access it;
ae = new AudioEngine(#"Content\game_content\audio\xact\Win\xna xact file.xgs");
This line apparently gets the \x86\debug path.
Any advice?
Thanks
Visual Studio, go to the Solution Explorer and right click the Content solution (i.e. "TheGameContent (Content)") or a folder in that section and select Add > Existing Item... and select the .xap file. If it isn't in there, it will copy the file into TheGame/Content, but it will also make it ready to load and work within your project.
Basically it's the same as adding an image file to an XNA project, and it will save you all that trouble you are having.
I have two questions about the Sublime Text Editor 2.
My 1st question is, I have several different .tmLanguage files ( ex: Console.tmLanguage) or .tmbundle (Ex: Handlebars.tmbundle) saved in the Packages/User folder. But it won't detect by the Sublime when the initial loads. If I move them under the Package folder, sublime will see them as a color syntax setting.
I thought everything should store inside the User Folder so that it won't be erased when updates or any other possible overwritten situations. What can I do to make sublime see those file when they are stored inside User folder.
I have moved those file several different locations. When I initialized sublime, I received this error " Error loading syntax file "Packages/User/Console.tmLanguage": Error parsing plist xml: Failed to open file In file "Packages/User/Console.tmLanguage" "
I did research about this error, one of the file maybe use that color setting has been cached. I could not remember that which one is using it. How can I clear all the cache to get rid of this initial loading error?
My 2nd question is, I am sharing the Preferences.sublime-settings file for Windows and Mac via Dropbox. But Mac has high resolution, window has not. Mac need font size of 21 to show the same size on windows( font-size: 14 ). Every time When I sync the setting, I have to switch this value from setting file. So I created two different files, Preferences (OSX).sublime-settings and Preferences (Windows).sublime-settings to hold the font-size setting only. It seems to work on windows, but Mac just ignore that file, no font size is being applied at all. It is so tiny that I could not see. Any ideas how could I fix that?
I solved the 2nd problem (i.e. eliminating display differences) as follows:
Create the Default folder that will "mirror" Default.sublime-package:
Window 7:
%USERPROFILE%\AppData\Roaming\Sublime Text 3\Packages\Default
Mac OS X:
~/Library/Application Support/Sublime Text 3/Packages/Default
Extract two files from Default.sublime-package into this folder:
Preferences (OSX).sublime-settings
Preferences (Windows).sublime-settings
I used the following settings to get the same look and feel on Windows 7/XP and MacBook with Retina:
Windows:
{
"font_face": "Consolas",
"font_size": 11,
"line_padding_top": -1
}
Mac OS X:
{
"font_face": "Consolas",
"font_size": 14,
"line_padding_bottom": -1,
}
According to this post in the Sublime Text forums, you need to remove an existing .tmlanguage file from the /Packages folder AND the .tmlanguage.cache file and relaunch Sublime Text to confirm that the program is no longer reading them. Then you can put your .tmlanguage or .tmbundle file in /Packages/User.
It's not clear to me that the error message you got was indicating a problem with the location and not a problem with the plist file itself. You might try using one of the free plist editors to make sure the structure of the file itself is OK.
Good luck on the Mac/Windows display difference. I have no idea how you might solve that.
For windows delete - Delete all the sublime files from
C:\Users\\AppData\Roaming
I'm interested in some information inside a shadow file (.shd) located inside the windows print spooling directory "C:\Windows\System32\spool\PRINTERS". Every time a print job is started, a spool file (.spl) and a shadow file (.shd) are created in that directory. So far I have been successful in detecting when a print job has started, and have been able to pause that print job. If you don't pause the job, the files eventually make their way to the printer and then are deleted by windows.
My problem is. I cannot open the .SHD files because they are locked in such a way that you can not read them while they are open by the sprint spooler. I've even tried going to the file in windows explorer and simply copying the file to another file, and that didn't work either. The .SPL spool files I can open though. I simply wait, and fairly quickly the spooler release that file. For the shadow file though, it permanently holds on to this file. Unfortunately, its the one I need.
The line of code I'm using specifically to open the file is as follows:
m_spoolJobStream = new FileStream(spoolFilePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
The IOException I get is:
The process cannot access the file 'C:\Windows\system32\spool\PRINTERS\FP00083.SHD' because it is being used by another process.
So yes, it is being used by another process. Its being used by the window's print spooler service. But I don't think there is anything I can do about that. All I want to do is read the file. I don't want to make any changes to it. Is there anything I can do here or am I just screwed?
Check the option: "Keep printed documents" (if you have HP printer) and then see your spool file folder, both shadow and spool files would be there.
Well, I did not find a way around this problem. I suspect there is no solution for this and it is by design. However I did find another way to get the information I wanted (at least it seems so thus far).
I'm using the FindNextPrinterChangeNotification() routine out of the winspool.drv library. This guy returns a pointer to a PRINTER_NOTIFY_INFO structure, which in turn contains an array of PRINTER_NOTIFY_INFO_DATA structures. Within that array, there is an element with its "Field" member marked as "JOB_NOTIFY_FIELD_DEVMODE". This element contains a fairly large structure of type DEVMODE. The structure is explained by M$ here http://msdn.microsoft.com/en-us/library/dd183565%28v=vs.85%29.aspx . This structure looks like it contains what I'm looking for and apparently is wrapped up in the .SHD file anyways according to this page http://www.undocprint.org/formats/winspool/shd. I'd like to know what else is in that .SHD file, but I still can't open it because its locked while the job is paused, and I suspect that it stays locked until the job is complete. Oh well, I think my new solution is more elegant anyways.
Just make sure you pause the job in the spool on BOTH your box and the server, then you should be able to copy/open/move the shd file just like you can the spl file. Worked for me, anyway...
This works for me:
- Hang your printer (e.g. jam the paper)
- Print and observe .SHD and .SPL being created
- Stop Print Spooler
- Open the file
The problem might be the FileShare.ReadWrite parameter. You're asking to read and write on the file and maybe that's why you get an error. You should try asking for read-only permission.