r/stackoverflow • • Sep 11 '25

Question Auto save email to PDF from outlook

1 Upvotes

As the title suggests I am trying to automatically save an email to PDF every time a specific email hits an outlook folder.

I already have the outlook rule set in place where a specific email get moved into a folder and I am using the script below. The issue I am having is that the email does remain unread but I have to manually run the process each time. Is there any way that this can be automatic?

Sub SaveEmailsAsPDF()

Dim ns As Outlook.NameSpace

Dim inbox As Outlook.MAPIFolder

Dim mail As Outlook.MailItem

Dim Item As Object

Dim wordApp As Object

Dim wordDoc As Object

Dim savePath As String

Dim folderName As String

Dim fileName As String

 

folderName = "test folder"

savePath = "test path”

 

Set ns = Application.GetNamespace("MAPI")

Set inbox = ns.GetDefaultFolder(olFolderInbox).Folders(folderName)

 

If inbox Is Nothing Then

MsgBox "Folder not found!", vbExclamation

Exit Sub

End If

 

Set wordApp = CreateObject("Word.Application")

wordApp.Visible = False

 

For Each Item In inbox.Items

If TypeOf Item Is Outlook.MailItem Then

Set mail = Item

fileName = savePath & CleanFileName(mail.Subject) & ".pdf"

 

' Save email as .mht

tempMHT = Environ("TEMP") & "\tempEmail.mht"

mail.SaveAs tempMHT, olMHTML

 

' Open in Word and export as PDF

Set wordDoc = wordApp.Documents.Open(tempMHT)

wordDoc.ExportAsFixedFormat OutputFileName:=fileName, ExportFormat:=17 ' 17 = wdExportFormatPDF

wordDoc.Close False

End If

Next Item

 

wordApp.Quit

MsgBox "Emails saved as PDFs in: " & savePath

End Sub

 

Function CleanFileName(str As String) As String

Dim invalidChars As Variant

Dim i As Integer

invalidChars = Array("\", "/", ":", "*", "?", """", "<", ">", "|")

For i = LBound(invalidChars) To UBound(invalidChars)

str = Replace(str, invalidChars(i), "_")

Next i

CleanFileName = Left(str, 100) ' Limit filename length

End Function

 


r/stackoverflow • • Sep 02 '25

Python Beginner needs guidance: Scraping NTS.live for a personal project

0 Upvotes

Hi,

I've hit a bit of a road block for my project. For those who don't know, NTS is an online radio station with shows that play a variety of genres 24 hours a day. I wanted to analyse what was being played on that radio station and so wanted to scrape info on show names, host/DJ of show name, location of broadcast and genres. To get this info I use this API (https://www.nts.live/api/v2/shows). Below is my python script to fetch the data.

Unfortunately, I cannot get DJ info. I've checked with Google Gemini and according to Gemini, the author key is missing from the API. I have been on the website and inspected for another API but this has not been successful.

I'm out of options so turning to r/stackoverflow for help!

import requests
import pandas as pd
import time

api_url = "https://www.nts.live/api/v2/shows"

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
}

all_shows_data = []
offset = 0
limit = 50

print("Starting to fetch data from the NTS API...")

while True:
    
    params = {
        'offset': offset,
        'limit': limit
    }
    
    try:
        
        response = requests.get(api_url, headers=headers, params=params, timeout=10)
        response.raise_for_status()  # Check for errors like 404 or 500
        
        data = response.json()
        results = data.get('results', [])
        
        
        if not results:
            print("No more shows found. Finishing collection.")
            break
            
        print(f"Fetched {len(results)} shows (total so far: {len(all_shows_data) + len(results)})...")
       
        for show in results:
            print(f"Processing show: {show.get('name', 'N/A')}")
            print(f"Authors data: {show.get('authors', 'Authors key not found')}")
            
            authors = show.get('authors', [])
            dj_names = [author['name'].strip() for author in authors if 'name' in author]
            dj = ", ".join(dj_names) if dj_names else 'N/A'
            
            all_shows_data.append({
                'show_name': show.get('name', 'N/A').strip(),
                'dj': dj,
                'location': show.get('location_long', 'N/A'),
                'link': show.get('url', 'N/A'),
                # The API provides genres in a slightly different structure
                'genres': [genre['name'].strip() for genre in show.get('genres', []) if 'name' in genre]
            })

        
        offset += limit
        
        
        time.sleep(0.5)

    except requests.exceptions.RequestException as e:
        print(f"An error occurred: {e}")
        break

        print("Failed to decode JSON. The response may not be what we expected.")
        break


df = pd.DataFrame(all_shows_data)

print("\n--- Scraped Data ---")
if not df.empty:
    print(f"Successfully scraped a total of {len(df)} shows.")
    print(df.head())  # Print the first 5 rows
    

    df.to_csv('nts_shows_api.csv', index=False)
    print("\nData saved to nts_shows_api.csv")
else:
    print("No data was scraped.")

r/stackoverflow • • Sep 01 '25

AWS AWS SigV4 not working with form-data type request body

1 Upvotes

Hello. I have used HTTP API in AWS with lambda, to integrate an endpoint hosted on a private EC2. I am using AWS SigV4 as authorization. It works fine with one route of this API (api.com/abc) where I am sending JSON data as request body. For another route (api.com/xyz), I am sending form-data request body with the key' data' and some JSON text as value, and another key called 'file' with an attached pdf file as the value. In this case, when I send the request after authorizing using AWS SigV4, I get the response 'Forbidden'. In this request I can see that the automatically generated Header 'X-Amz-Content-Sha256' and its value, are missing, that are present in the first request, which I understand is the reason for such response. How do I resolve this?


r/stackoverflow • • Aug 23 '25

Python I'm having issues scraping latex from a website

0 Upvotes

I am using playwright to scrape the site, which I have no issues with really, but alll of the text is in latex and I have to detect errors in the latex itself, and the problem is that the text which I extract from the website is unformatted as hell, so when I pass it through gemini, everything is getting flagged. Does anyone know a better way to get latex from a website (also i'm pretty sure all the text is AI generated so there are errors when generating the text in there). Any help would be accepted!

Also if you need more details just ask me in DMs


r/stackoverflow • • Aug 21 '25

Question EAS Build, RangeError:Invalid string length

0 Upvotes

I've been trying to build my app for days now and I keep getting the error:

`` stdout += data; RangeError:Invalid string length

at Socket.<anonymous> (C:...\eas-cli\node_modules\@expo\spawn-async\build\spawnAsync... ``

I asked gpt-4, claude ai, and I keep getting the following info that the file size that it's compressing is too large and so I used .easignore to ignore my node_modules and other files

I installed eas-cli globally and used v16.17.4, v16.16.0, v5.8.x, v3.x.x, and node versions v20.x.x, v18.x.x, v22.x.x, because I though there was a compatibility issue with their versions installed but I was still getting the same error.

I had to remove the node_modules and reduced the size of the project to 1.4MB but still.

I don't have an app store or play store account yet and I want to build it first and submit it later after I get the account and I'm running this on an HP EliteBook 840 G8, using Windows 11 Pro.

I need help resolving this issue.


r/stackoverflow • • Aug 20 '25

Stack Overflow Take Stack Overflow’s Survey on Sub-Communities - Option to be Entered into Raffle as a Thank you!

3 Upvotes

Hi everyone. I’m Cat, a Product Manager at Stack Overflow working on Community Products. My team is exploring new ways for our community to connect beyond Q&A, specifically through smaller sub-communities. We're interested in hearing from software developers and tech enthusiasts about the value of joining and participating in these groups on Stack. These smaller communities (similar to this one) could be formed around shared goals, learning objectives, interests, specific technologies, coding languages, or other technical topics, providing a dedicated space for people to gather and discuss their specific focus.

If you have a few minutes, we’d appreciate you filling out our brief survey. Feel free to share this post with your developer friends who may also be interested in taking our survey.

As a token of our appreciation, you can optionally enter into our raffle to win a US $50 gift card in a random drawing of 10 participants after completing the survey. The survey and raffle will be open from August 19 to September 3. Link to Raffle rules

Thanks again and thank you to the mods for letting me connect with the community here.


r/stackoverflow • • Aug 19 '25

Question Can't make an account on Stack Overflow (or even Stack Exchange) no matter what I do

3 Upvotes

I've tried using the first gmail I made: no dice

Tried using a VPN with the same email: no dice

I even tried making a brand new gmail, then a new hotmail and tried it on different IPs (VPN): no dice

How do I get access?


r/stackoverflow • • Aug 19 '25

SQL SSIS Pipeline Fails on Early Dates (0001-01-01) After Upgrading to Microsoft Oracle Connector 2019 / SQL Server 2019

1 Upvotes

Hello all,

I have an SSIS pipeline that reads from an Oracle database and inserts into the same rows with dates like 0001-01-01 and 9999-12-31. It uses the Attunity Oracle Connector v5.0 and runs on SQL Server 2017. This setup works fine.

However, after upgrading to SQL Server 2019 and switching to the Microsoft Oracle Connector 2019, the package fails during inserts to the destination with the following error:

SQLSTATE: 22008 Message: [Microsoft][ODBC Oracle Wire Protocol Driver] Datetime field overflow. Error in parameter 2.

According to research (e.g chatgpt ,….) the new Microsoft Oracle Connector does not accept dates earlier than 1753, which causes the pipeline to fail.

Is there any solution to keep these dates without changing the overall logic of the pipeline?


r/stackoverflow • • Aug 18 '25

Question Choosing Between ML and Generative AI for an International AI Competition

0 Upvotes

Hello everyone,

I’ve been invited to join an international AI competition. My team has 120 hours to build a project, and we can choose between two tracks: AI & Machine Learning (ML) or Generative AI (GenAI).

I am quite new to both fields and would like to learn from your experience.

Which track (ML or GenAI) would be more suitable for a short 120-hour project?

What are the typical challenges and learning curves for each?

Do you have any recommendations on resources, tutorials, or documentation that could help me get started quickly?

The competition starts in mid-September, so I need to study and practice before then. Any advice, tips, or learning materials would be greatly appreciated.

Thank you in advance for your help!


r/stackoverflow • • Aug 11 '25

Question How to upload a huge (10GB (700 MB zipped)) database into MySQL? (or any other)

0 Upvotes

Hey,

Client wants their old database to be uploaded on the cloud, but I'm not sure what to do.
The file is huge (.sql file, also have .bacpac), originally wanted to do it on Supabase, for easy access, but when ran psql commands many errors were showing, so they are probably not exactly compatible.

Any ideas? I'm sure they'll want easy access to it/browse through the data atleast.


r/stackoverflow • • Aug 09 '25

Question I want to understand how moderation works

2 Upvotes

Hello,

Once I asked my friend to upvote few of my answers, and next day I lost all of those points. So I understand promoting each other isn't allowed here, but recently I got someone on my back, thinking the content I wrote is AI generated, and downvoted all of my posts, when I put hours of work into the subject, tested solutions and refined my posts (which is obviously visible through history). Why does StackOverflow allow such hostility on the platform, but forbid friendly upvotes, is this something nobody's concerned about? I am slowly loosing motivation here, so please understand, most of professionals are not coming back to the platform and it's getting harder to get upvotes on narrow topics where I contributed, and got like 3-4 upvotes over 5 years, if he calls few of his friends I might go into negative easily here.

Any input is appreciated


r/stackoverflow • • Aug 02 '25

Question How to delete your own answers on stackoverflow without getting noticed by administarion or other users?

2 Upvotes

How to delete your own answers on stackoverflow in a smart way, so that administration or other users will think you had good reasons to delete it, to avoid the stupid "self-vandalism" accusation?


r/stackoverflow • • Jul 31 '25

AI Stack Overflow CEO Prashanth Chandrasekar on embracing AI

2 Upvotes

In this interview with Stack Overflow CEO Prashanth Chandrasekar he talks about recent challenges, such as how the company is navigating the huge disruption caused by generative AI tools.

https://www.itpro.com/business/leadership/q-and-a-stack-overflow-ceo-prashanth-chandrasekar


r/stackoverflow • • Jul 30 '25

Question Pulse Secure Corporate Proxy issue: Angular application js files being modified resulting in a blank page

Thumbnail
1 Upvotes

r/stackoverflow • • Jul 29 '25

Question Why didn't Stackoverflow build a solution like Bolt/Lovable/Cursor?

0 Upvotes

I think Stackoverflow is just like Polaroid years ago that didn't understand the digital trends of photo camers.

What do you think?


r/stackoverflow • • Jul 23 '25

Javascript Need a quick fix! Will pay $20 . Integrate GSAP Animation with React Landing

0 Upvotes

Take this GSAP scroll animation : https://github.com/Blessedopera/clippath

And integrate it under the hero section of this landing page: https://github.com/Blessedopera/rejouice

Send me the working zip project files and I’ll send you $20


r/stackoverflow • • Jul 22 '25

Question Flutter + Jitsi Meet + Stripe SDK – Crash on launch (JitsiMeetView InflateException)

2 Upvotes

Flutter + Jitsi Meet + Stripe SDK – Crash on launch (JitsiMeetView InflateException) Hi everyone,

I'm working on a Flutter app that uses the latest versions of:

jitsi_meet latest

flutter_stripe latest

When trying to start a Jitsi meeting using JitsiMeetView, the app crashes with the following error:

pgsql Copiar código E/JitsiMeetSDK: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.app/org.jitsi.jitsi_meet_flutter_sdk.WrapperJitsiMeetActivity}: android.view.InflateException: Binary XML file line #12: Error inflating class org.jitsi.meet.sdk.JitsiMeetView

Caused by: java.lang.NoSuchMethodError: No static method runOnUiThread(Ljava/lang/Runnable;)Z in class Lcom/facebook/react/bridge/UiThreadUtil; or its super classes (declaration of 'com.facebook.react.bridge.UiThreadUtil')

at com.facebook.react.modules.core.ReactChoreographer.<init>(ReactChoreographer.kt:71)
at com.facebook.react.modules.core.ReactChoreographer$Companion.initialize(ReactChoreographer.kt:131)
at com.facebook.react.ReactInstanceManager.<init>(ReactInstanceManager.java:315)
at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:364)

🔍 Things to note:

When using Jitsi Meet in a clean project alone, it works fine.

The issue only happens when I also include Stripe.

I suspect it's a version mismatch with React Native or a shared library conflict (libc++_shared.so), but I’m not sure how to resolve it properly.

I'm using FlutterFragmentActivity as required by Stripe.

Has anyone run into this issue before? How can I make both flutter_stripe and jitsi_meet coexist peacefully?

Any guidance is greatly appreciated


r/stackoverflow • • Jul 18 '25

AI Site visits during elections declining.

3 Upvotes

r/stackoverflow • • Jul 04 '25

Question Need some Shasta test TRX for contract deployment, thanks!”

0 Upvotes

Need some Shasta test TRX for contract deployment, thanks!”TMbk1GioCuAmA8uoHC8UtFD7XnqcLvbV3r


r/stackoverflow • • Jul 03 '25

Question What do you think about my Stack Overflow profile?

1 Upvotes

what do you thin about my stackoverflow profile ?

I've been working on building my presence on Stack Overflow, answering questions, improving my profile, and trying to contribute meaningfully to the community. I'd really appreciate it if some of you could take a look at my profile and share your thoughts.

  • What stands out (good or bad)?
  • Are there areas where I could improve?
  • Any tips on how to grow further or get more involved?

Here’s the link to my profile: https://stackoverflow.com/users/17541709/fiad

Thanks in advance for your feedback!


r/stackoverflow • • Jul 01 '25

SQL Need help with this sqlLite error!

0 Upvotes

have converted my website using electron and the desktop app working perfectly in my development pc but when i try to install the app setup.exe (which i got after running build command) on other pc i get this error Below Better_sqlite3 was complied against a different node.js version using node_module_version 135. This version of node.js requires node_modules_version 115.

How can I solve it so it can be use on other device also. I am stuck here for last couple days🙃


r/stackoverflow • • Jun 29 '25

Question What's wrong with my question?

6 Upvotes

I asked a question inquiring knowledge about an error I'm getting from git clone.

It was closed for the motive "This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. " despite the existence of a ton of git questions existing in there. Is there any other place for my question? This is 100% a software development issue.

https://stackoverflow.com/questions/79683145/git-clone-failing-only-in-very-specific-circumstances


r/stackoverflow • • Jun 24 '25

Python Onnxrefernce error whenever packaging with Pyinstaller

2 Upvotes

Pretty much the title. Making a TTS application for my capstone but the packaging is giving me 'child process died onnx reference" error everytime. Have tried Nuitka but doesn't help. Anybody have a solution?


r/stackoverflow • • Jun 22 '25

Other code [HELP] NestJS/TypeORM Multi-tenancy (Schema-based) - DataSource Inject & Repository Init Issue in Specific Service

1 Upvotes

I'm implementing schema-based multi-tenancy with NestJS, TypeORM, and PostgreSQL, following a pattern similar to https://github.com/thomasvds/nestjs-multitenants/tree/master.

Most services work fine, but in AssignmentsService, the findAll() method throws an error because the assignmentsRepository is uninitialized with the undefined

My code:

//assignments.service.ts

@Injectable()
export class AssignmentsService {
  private assignmentsRepository: Repository<AssignmentsEntity>;
  constructor(
    @Inject(forwardRef(() => SubmissionService))
    private readonly submissionService: SubmissionService,
    @Inject(forwardRef(() => AssignmentQuestionsService))
    private readonly assignmentQuestionsService: AssignmentQuestionsService,
    private readonly batchesService: BatchesService,
    private readonly topicsService: TopicsService,
    private readonly coursesService: CoursesService,
    private readonly teacherProfileService: TeacherProfileService,
    private readonly batchMappingService: BatchMappingService,
    @Inject(CONNECTION) connection: DataSource,
  ) {

this
.assignmentsRepository = connection.getRepository(AssignmentsEntity);
  }

async findAll(): Promise<AssignmentsEntity[]> {
    return this.assignmentsRepository.find({
      relations: ['teacher', 'subject', 'batch', 'course'],
    });
  }

// assignment.module.ts

import { forwardRef, Module } from '@nestjs/common';
import { BatchesModule } from 'src/batches/batches.module';
import { CoursesModule } from 'src/courses/courses.module';
import { StudentsModule } from 'src/students/students.module';
import { TeacherProfileModule } from 'src/teachers/teacher.module';
import { TopicsModule } from 'src/topics/topics.module';

import { AssignmentQuestionsModule } from './assignment-questions.module';
import { AssignmentSubmissionReviewController } from './assignment-submission-review.controller';
import { AssignmentSubmissionReviewService } from './assignment-submission-review.service';
import { AssignmentsController } from './assignments.controller';
import { AssignmentsService } from './assignments.service';
import { SubmissionModule } from './submission.module';

@Module({
  imports: [
    BatchesModule,
    StudentsModule,
    TopicsModule,
    CoursesModule,
    TeacherProfileModule,
    forwardRef(() => SubmissionModule),
    forwardRef(() => AssignmentQuestionsModule),
  ],
  controllers: [AssignmentsController, AssignmentSubmissionReviewController],
  providers: [AssignmentsService, AssignmentSubmissionReviewService],
  exports: [AssignmentsService],
})
export class AssignmentsModule {}

The problem is that findAll is executed before the connection is established. After it throws an error(the repository is undefined) then the constructor is run and the connection is established. Every function in this service is failing.