Automatically print Record Links

shrekut
Member Posts: 27
Can anyone help me with Automatically printing Record Links? This means that the file in the record link's URL will need to be called and automatically printed without the user having to do anything except posting.
Thanks...
Thanks...
0
Comments
-
[Topic moved from SQL Performance forum to Navision forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
This peace of code might be able to help you.
//The following Function is using Automation Objects from 'Microsoft Shell Controls And Automation' (Shell32). PrintFile( FileName : Text[250]) CREATE(objShell); IF NOT EXISTS(FileName) THEN EXIT; SplitDirFile(FileName,Dir,File); objFolder := objShell.NameSpace(Dir); objFolderItems := objFolder.Items; objFolderItem := objFolderItems.Item(File); objVerbs := objFolderItem.Verbs; i:=-1; REPEAT i+=1; IF i<objVerbs.Count THEN objVerb := objVerbs.Item(i); UNTIL (STRPOS(UPPERCASE(objVerb.Name),'PRINT')>0) OR (i >=objVerbs.Count); IF i<=objVerbs.Count THEN BEGIN objVerb.DoIt; END ELSE ERROR('Could not print file %1\Make sure you use a file extension you can print from Windows Explorer', FileName);
Source: http://www.mibuso.com/forum/viewtopic.php?t=72930 -
hello, is this useful if i want to make a report that prints for example a list of items?
i have 3000 items and a high quality picture in the record link of each item.
i now want to create a report with a picture box that has this jpeg-image.
is this possible?0 -
I have refloated this post because i want to use this function but i have a lot of questions...
PrintFile( FileName : Text[250])
CREATE(objShell); --> I think the subtype is 'Microsoft Shell Controls And Automation'.Shell???
IF NOT EXISTS(FileName) THEN
EXIT;
SplitDirFile(FileName,Dir,File); --> Is this a function? Why? And the parameteres?
objFolder := objShell.NameSpace(Dir); --> --> I think the subtype is 'Microsoft Shell Controls And Automation'.Folder
objFolderItems := objFolder.Items; --> --> I think the subtype is 'Microsoft Shell Controls And Automation'.FolderItems
objFolderItem := objFolderItems.Item(File); --> --> I think the subtype is 'Microsoft Shell Controls And Automation'.FolderItem???
objVerbs := objFolderItem.Verbs;
i:=-1;
REPEAT
i+=1;
IF i<objVerbs.Count THEN
objVerb := objVerbs.Item(i);
UNTIL (STRPOS(UPPERCASE(objVerb.Name),'PRINT')>0) OR (i >=objVerbs.Count);
IF i<=objVerbs.Count THEN BEGIN
objVerb.DoIt;
END ELSE
ERROR('Could not print file %1\Make sure you use a file extension you can print from Windows Explorer', FileName);
And finally, when you print the document?
Can somebody help me with these questions?0 -
This is all the code you need to print...
It doesn´t show any error but it doesn´t print!!! ](*,)
Funcion 1: SplitDirFile
Valiables locales:Name DataType Subtype Length
PointBreak Integer
ExitLoop Boolean
SplitDirFile(FullString : Text[250];VAR JustDir : Text[250];VAR JustFileName : Text[250])
ExitLoop := FALSE;
PointBreak := STRLEN(FullString);
WHILE (NOT ExitLoop) OR (PointBreak <= 1) DO
IF COPYSTR(FullString,PointBreak,1) = '\' THEN BEGIN
JustFileName := COPYSTR(FullString,PointBreak + 1);
ExitLoop := TRUE;
END ELSE
PointBreak -= 1;
JustDir := COPYSTR(FullString,1,PointBreak);
Funcion 2: PrintFile
Variables LocalesName DataType Subtype Length
objShell Automation 'Microsoft Shell Controls And Automation'.Shell
objFolder Automation 'Microsoft Shell Controls And Automation'.Folder
objFolderItems Automation 'Microsoft Shell Controls And Automation'.FolderItems
objFolderItem Automation 'Microsoft Shell Controls And Automation'.FolderItem
objVerbs Automation 'Microsoft Shell Controls And Automation'.FolderItemVerbs
Dir Text 250
Filename Text 250
PrintFile(PrintThisFile : Text[250])
IF ISCLEAR(objShell) THEN
CREATE(objShell);
IF NOT EXISTS(Filename) THEN
EXIT;
SplitDirFile(PrintThisFile,Dir,Filename);
objFolder := objShell.NameSpace(Dir);
objFolderItems := objFolder.Items;
objFolderItem := objFolderItems.Item(Filename);
objFolderItem.InvokeVerb('PRINT');
objVerbs := objFolderItem.Verbs;
i:=-1;
REPEAT
i+=1;
IF iobjVerb := objVerbs.Item(i);
UNTIL (STRPOS(UPPERCASE(objVerb.Name),'PRINT')>0) OR (i >=objVerbs.Count);
IF i<=objVerbs.Count THEN BEGIN
objVerb.DoIt;
END ELSE
ERROR('Could not print file %1\Make sure you use a file extension you can print from Windows Explorer', FileName);
Whyyyyyyy I can´t print? ](*,) ](*,)0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions